時間伸長・短縮処理を行うクラス。 一定間隔でデータを間引き・コピーすることで、 音程を変えることなく再生時間を伸長・短縮する。
モノラルと処理内容に大差ないんで、クラスを分ける必要ないのかも。
Inheritance: Pipe
Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        public PitchShifter(Queue input, Queue temp1, Queue temp2, Queue output, int size, int overlap, double rate, int maxSkip)
            : base(input, output)
        {
            this.cap = new EllipticFilterDesigner(8, 0.99, 0.05).GetAnalogPrototype();
            this.cd  = new Coefficient[this.cap.Length];
            for (int i = 0; i < this.cd.Length; ++i)
            {
                this.cd[i] = new Coefficient();
            }
            this.peq = new ParametricEqualizer.Parameter[this.cap.Length];
            for (int i = 0; i < this.peq.Length; ++i)
            {
                this.peq[i] = new ParametricEqualizer.Parameter();
            }
            this.pipes = new Pipe[3];

            this.fl = new ParametricEqualizer(this.peq);
            this.fr = new ParametricEqualizer(this.peq);

            this.ts    = new TimeStretcher(input, output, size, overlap, 1.0 / rate, maxSkip);
            this.rt    = new RateTransposer(input, output, rate);
            this.fp    = new FilteredPipe(input, output, fl, fr);
            this.temp1 = temp1;
            this.temp2 = temp2;

            this.SetRate(rate);
            this.cp = new CascadePipe(this.pipes);
        }
Esempio n. 2
0
		/// <summary>
		/// 
		/// </summary>
		public PitchShifter(Queue input, Queue temp1, Queue temp2, Queue output, int size, int overlap, double rate, int maxSkip)
			: base(input, output)
		{
			this.cap = new EllipticFilterDesigner(8, 0.99, 0.05).GetAnalogPrototype();
			this.cd= new Coefficient[this.cap.Length];
			for(int i=0; i<this.cd.Length; ++i) this.cd[i] = new Coefficient();
			this.peq = new ParametricEqualizer.Parameter[this.cap.Length];
			for(int i=0; i<this.peq.Length; ++i) this.peq[i] = new ParametricEqualizer.Parameter();
			this.pipes = new Pipe[3];

			this.fl = new ParametricEqualizer(this.peq);
			this.fr = new ParametricEqualizer(this.peq);

			this.ts = new TimeStretcher(input, output, size, overlap, 1.0/rate, maxSkip);
			this.rt = new RateTransposer(input, output, rate);
			this.fp = new FilteredPipe(input, output, fl, fr);
			this.temp1 = temp1;
			this.temp2 = temp2;

			this.SetRate(rate);
			this.cp = new CascadePipe(this.pipes);
		}