mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:12:43 +00:00 
			
		
		
		
	 a749b16674
			
		
	
	
		a749b16674
		
	
	
	
	
		
			
			LibDSP is a library for digital signal processing, and is primarily intended to support the future DAW version of Piano.
		
			
				
	
	
		
			45 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, kleines Filmröllchen <malu.bertsch@gmail.com>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include "Processor.h"
 | |
| #include "ProcessorParameter.h"
 | |
| #include "Transport.h"
 | |
| #include <AK/Types.h>
 | |
| 
 | |
| namespace LibDSP::Effects {
 | |
| 
 | |
| // A simple digital delay effect using a delay buffer.
 | |
| // This is based on Piano's old built-in delay.
 | |
| class Delay : public EffectProcessor {
 | |
| public:
 | |
|     Delay(NonnullRefPtr<Transport>);
 | |
| 
 | |
| private:
 | |
|     virtual Signal process_impl(Signal const&) override;
 | |
|     void handle_delay_time_change();
 | |
| 
 | |
|     ProcessorRangeParameter m_delay_decay;
 | |
|     ProcessorRangeParameter m_delay_time;
 | |
|     ProcessorRangeParameter m_dry_gain;
 | |
| 
 | |
|     Vector<Sample> m_delay_buffer;
 | |
|     size_t m_delay_index { 0 };
 | |
|     size_t m_old_delay_size = m_delay_buffer.size();
 | |
| };
 | |
| 
 | |
| // A simple effect that applies volume, mute and pan to its input signal.
 | |
| // Convenient for attenuating signals in the middle of long chains.
 | |
| class Mastering : public EffectProcessor {
 | |
| public:
 | |
|     Mastering(NonnullRefPtr<Transport>);
 | |
| 
 | |
| private:
 | |
|     virtual Signal process_impl(Signal const&) override;
 | |
| };
 | |
| 
 | |
| }
 |