arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
audio_tools::FaustStream< DSP > Class Template Reference

Integration into Faust DSP see https://faust.grame.fr/ To generate code from faust, select src and cpp. More...

#include <AudioFaust.h>

Inheritance diagram for audio_tools::FaustStream< DSP >:
audio_tools::AudioStreamX audio_tools::AudioStream Stream audio_tools::AudioBaseInfoDependent audio_tools::AudioBaseInfoSource Print

Public Member Functions

 FaustStream (bool useSeparateOutputBuffer=true)
 Constructor for Faust as Audio Source.
 
 FaustStream (Print &out, bool useSeparateOutputBuffer=true)
 Constructor for Faust as Singal Processor - changing an input signal and sending it to out.
 
int available () override
 
int availableForWrite () override
 
bool begin (AudioBaseInfo cfg)
 Checks the parameters and starts the processing.
 
virtual FAUSTFLOAT bend ()
 
AudioBaseInfo defaultConfig ()
 
void end ()
 Ends the processing. More...
 
virtual FAUSTFLOAT frequency ()
 
virtual FAUSTFLOAT gain ()
 
dspgetDSP ()
 Provides a pointer to the actual dsp object.
 
virtual FAUSTFLOAT labelValue (const char *label)
 Determines the value of a parameter.
 
virtual bool midiOff (int note)
 
virtual bool midiOn (int note, FAUSTFLOAT gain)
 
size_t readBytes (uint8_t *data, size_t len) override
 Used if FaustStream is used as audio source. More...
 
virtual bool setBend (FAUSTFLOAT bend)
 
virtual bool setFrequency (FAUSTFLOAT freq)
 
virtual bool setGain (FAUSTFLOAT gain)
 
virtual bool setLabelValue (const char *label, FAUSTFLOAT value)
 Defines the value of a parameter.
 
virtual bool setMidiNote (int note)
 
size_t write (const uint8_t *write_data, size_t len) override
 Used if FaustStream is used as audio sink or filter. More...
 
- Public Member Functions inherited from audio_tools::AudioStreamX
virtual int available () override
 
virtual int peek () override
 
virtual int read () override
 
virtual size_t readBytes (uint8_t *buffer, size_t length) override
 
virtual size_t write (const uint8_t *buffer, size_t size) override
 
virtual size_t write (uint8_t) override
 
- Public Member Functions inherited from audio_tools::AudioStream
 AudioStream (AudioStream const &)=delete
 
virtual AudioBaseInfo audioInfo () override
 
virtual int availableForWrite () override
 
virtual bool begin ()
 
virtual void end ()
 
virtual void flush ()
 
 operator bool ()
 
AudioStreamoperator= (AudioStream const &)=delete
 
virtual size_t readBytes (char *buffer, size_t length)
 
virtual size_t readBytes (uint8_t *buffer, size_t length)=0
 
virtual void setAudioInfo (AudioBaseInfo info)
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi)
 
virtual size_t write (const uint8_t *buffer, size_t size)=0
 
- Public Member Functions inherited from Stream
virtual int available ()=0
 
bool find (char target)
 
bool find (const char *target)
 
bool find (const char *target, size_t length)
 
bool find (const uint8_t *target)
 
bool find (const uint8_t *target, size_t length)
 
bool findUntil (const char *target, const char *terminator)
 
bool findUntil (const char *target, size_t targetLen, const char *terminate, size_t termLen)
 
bool findUntil (const uint8_t *target, const char *terminator)
 
bool findUntil (const uint8_t *target, size_t targetLen, const char *terminate, size_t termLen)
 
unsigned long getTimeout (void)
 
float parseFloat (LookaheadMode lookahead=SKIP_ALL, char ignore=NO_IGNORE_CHAR)
 
long parseInt (LookaheadMode lookahead=SKIP_ALL, char ignore=NO_IGNORE_CHAR)
 
virtual int peek ()=0
 
virtual int read ()=0
 
size_t readBytes (char *buffer, size_t length)
 
size_t readBytes (uint8_t *buffer, size_t length)
 
size_t readBytesUntil (char terminator, char *buffer, size_t length)
 
size_t readBytesUntil (char terminator, uint8_t *buffer, size_t length)
 
String readString ()
 
String readStringUntil (char terminator)
 
void setTimeout (unsigned long timeout)
 
- Public Member Functions inherited from Print
virtual int availableForWrite ()
 
void clearWriteError ()
 
virtual void flush ()
 
int getWriteError ()
 
size_t print (char)
 
size_t print (const __FlashStringHelper *)
 
size_t print (const char[])
 
size_t print (const Printable &)
 
size_t print (const String &)
 
size_t print (double, int=2)
 
size_t print (int, int=DEC)
 
size_t print (long long, int=DEC)
 
size_t print (long, int=DEC)
 
size_t print (unsigned char, int=DEC)
 
size_t print (unsigned int, int=DEC)
 
size_t print (unsigned long long, int=DEC)
 
size_t print (unsigned long, int=DEC)
 
size_t println (char)
 
size_t println (const __FlashStringHelper *)
 
size_t println (const char[])
 
size_t println (const Printable &)
 
size_t println (const String &s)
 
size_t println (double, int=2)
 
size_t println (int, int=DEC)
 
size_t println (long long, int=DEC)
 
size_t println (long, int=DEC)
 
size_t println (unsigned char, int=DEC)
 
size_t println (unsigned int, int=DEC)
 
size_t println (unsigned long long, int=DEC)
 
size_t println (unsigned long, int=DEC)
 
size_t println (void)
 
size_t write (const char *buffer, size_t size)
 
size_t write (const char *str)
 
virtual size_t write (const uint8_t *buffer, size_t size)
 
virtual size_t write (uint8_t)=0
 
- Public Member Functions inherited from audio_tools::AudioBaseInfoDependent
virtual AudioBaseInfo audioInfo ()=0
 
virtual void setAudioInfo (AudioBaseInfo info)=0
 
virtual bool validate (AudioBaseInfo &info)
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi)=0
 

Protected Member Functions

void allocateFloatBuffer (int samples, bool allocate_out)
 Allocate the buffer that is needed by faust.
 
bool checkChannels ()
 Checks the input and output channels and updates the is_write or is_read scenario flags.
 
void convertFloatBufferToInt16 (int samples, void *data, FAUSTFLOAT **p_float_out)
 Converts the float buffer to int16 values.
 
void deleteFloatBuffer ()
 
FAUSTFLOAT noteToFrequency (uint8_t x)
 
- Protected Member Functions inherited from audio_tools::AudioStream
virtual int not_supported (int out)
 
- Protected Member Functions inherited from Stream
int findMulti (struct MultiTarget *targets, int tCount)
 
float parseFloat (char ignore)
 
long parseInt (char ignore)
 
int peekNextDigit (LookaheadMode lookahead, bool detectDecimal)
 
int timedPeek ()
 
int timedRead ()
 
- Protected Member Functions inherited from Print
void setWriteError (int err=1)
 

Protected Attributes

int buffer_allocated
 
int bytes_per_sample
 
AudioBaseInfo cfg
 
bool gate_exists = false
 
bool is_init = false
 
bool is_read = false
 
bool is_write = false
 
FAUSTFLOAT ** p_buffer =nullptr
 
FAUSTFLOAT ** p_buffer_out =nullptr
 
DSP * p_dsp = nullptr
 
Printp_out =nullptr
 
UI ui
 
bool with_output_buffer
 
- Protected Attributes inherited from audio_tools::AudioStream
AudioBaseInfo info
 
AudioBaseInfoDependentp_notify =nullptr
 
- Protected Attributes inherited from Stream
unsigned long _startMillis
 
unsigned long _timeout
 

Detailed Description

template<class DSP>
class audio_tools::FaustStream< DSP >

Integration into Faust DSP see https://faust.grame.fr/ To generate code from faust, select src and cpp.

Author
Phil Schatzmann

Member Function Documentation

◆ available()

template<class DSP >
int audio_tools::FaustStream< DSP >::available ( )
inlineoverridevirtual

Reimplemented from audio_tools::AudioStreamX.

◆ availableForWrite()

template<class DSP >
int audio_tools::FaustStream< DSP >::availableForWrite ( )
inlineoverridevirtual

Reimplemented from audio_tools::AudioStream.

◆ end()

template<class DSP >
void audio_tools::FaustStream< DSP >::end ( )
inlinevirtual

Ends the processing.

Reimplemented from audio_tools::AudioStream.

◆ readBytes()

template<class DSP >
size_t audio_tools::FaustStream< DSP >::readBytes ( uint8_t *  data,
size_t  len 
)
inlineoverridevirtual

Used if FaustStream is used as audio source.

Reimplemented from audio_tools::AudioStreamX.

◆ write()

template<class DSP >
size_t audio_tools::FaustStream< DSP >::write ( const uint8_t *  write_data,
size_t  len 
)
inlineoverridevirtual

Used if FaustStream is used as audio sink or filter.

Reimplemented from audio_tools::AudioStreamX.


The documentation for this class was generated from the following file: