Jamoma API  0.6.0.a19
TTSpatDBAP.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspSpatLib
4  *
5  * @brief Jamoma DSP SpatLib unit based on Distance-based amplitude panning (DBAP)
6  *
7  * @details DBAP permits sinks (speakers) to be positioned any way you want.
8  * Speaker configurations are not limited to circles/spheres surrounding a sweet spot, but can be used e.g. to locate speakers in several adjecent spaces.
9  * DBAP is matrix-based and ensures equal intensity while adjusting gains to each of the sinks in such a way that relative gain diminish with increasing distance from source to sink.
10  * The exact rolloff rate (in dB) can be controlled with the rolloff attribute of the #TTSpatDBAPRenderer class.
11  *
12  * @todo: Extend with a solution for interpolating to new matrix coefficients
13  *
14  * @authors Trond Lossius, Nils Peters, Timothy Place
15  *
16  * @copyright Copyright © 2011 by Trond Lossius, Nils Peters, and Timothy Place @n
17  * This code is licensed under the terms of the "New BSD License" @n
18  * http://creativecommons.org/licenses/BSD/
19  */
20 
21 
22 /*
23 
24 The following are development notes while developing TTSpatDBAP starting of from the source files foir TTSpatSnap:
25 
26  DIFFERENCES WITH SNAP :
27 
28  - sources need a width
29  - renderer needs to implement a global rolloff
30  - weight coefficient to be associated with each source-sink pair (a matrix)
31 
32  */
33 
34 
35 #ifndef __SPATDBAP_H__
36 #define __SPATDBAP_H__
37 
38 #include "TTDSP.h"
39 #include "TTSampleMatrix.h"
40 #include "TTSpatBase.h"
41 #include "TTSpatDBAPRenderer.h"
42 #include "TTSpatDBAPSource.h"
43 
44 
45 /** Jamoma DSP SpatLib unit based on Distance-based amplitude panning (DBAP)
46  *
47  * @details DBAP permits sinks (speakers) to be positioned any way you want.
48  * Speaker configurations are not limited to circles/spheres surrounding a sweet spot, but can be used e.g. to locate speakers in several adjecent spaces.
49  * DBAP is matrix-based and ensures equal intensity while adjusting gains to each of the sinks in such a way that relative gain diminish with increasing distance from source to sink.
50  * The exact rolloff rate (in dB) can be controlled with the rolloff attribute of the #TTSpatDBAPRenderer class.
51  */
52 class TTSpatDBAP : public TTSpatBase {
54 
55  TTSpatDBAPRenderer* getRenderer()
56  {
57  return (TTSpatDBAPRenderer*)mRenderer;
58  }
59 
60  TTSpatDBAPSource* getSource(int aSourceNumber) {
61  return (TTSpatDBAPSource*)&mSources[aSourceNumber];
62  }
63 
64 public:
65 
66  /** TODO: document
67  @param aValue Used to return the number of sinks.
68  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
69  */
70  TTErr getRolloff(TTValue& aValue);
71 
72 
73  /** TODO: document
74  @param aValue The desired number of sinks.
75  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
76  */
77  TTErr setRolloff(const TTValue& aValue);
78 
79 
80 
81  TTErr setSourceWidth(const TTValue& aWidth, TTValue& anUnused);
82  TTErr getSourceWidth(const TTValue& aRequestedChannel, TTValue& aWidth);
83 
84 
85  /** Unit Tests.
86  @param aReturnedTestInfo Information on the outcome of the tests.
87  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
88  */
89  virtual TTErr test(TTValue& aReturnedTestInfo);
90 
91 };
92 
93 
94 
95 #endif // __SPATDBAP_H__
virtual TTErr test(TTValue &aReturnedTestInfo)
Unit Tests.
A basic proof-of-concept spatial renderer where the audio of a source will snap to the nearest sink...
TTSpatDBAPRenderer contains attributes and methods that are specific to this particular spatialisatio...
A basic proof-of-concept spatial renderer where the audio of a source will snap to the nearest sink...
TTSampleMatrix holds some audio in a chunk of memory.
Jamoma DSP Library.
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
Jamoma DSP SpatLib unit based on Distance-based amplitude panning (DBAP)
Definition: TTSpatDBAP.h:52
TTErr setRolloff(const TTValue &aValue)
TODO: document.
Definition: TTSpatDBAP.cpp:64
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
The #TTSpatDBAPSource class provides an extended description of a source as compared to the TTSpatSou...
This class is eventually intended to provide a generalised interface for spatial renderers.
Definition: TTSpatBase.h:31
TTErr getRolloff(TTValue &aValue)
TODO: document.
Definition: TTSpatDBAP.cpp:57
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34