Isomet Modular Synthesiser (iMS) API
v1.4.2
iMS API
|
A table of CompensationPoints storing look-up data that can be transferred to memory in the Synthesiser. More...
#include <include/Compensation.h>
Public Member Functions | |
const bool | Save (const std::string &fileName) const |
Save Table contents to file using latest protocol version. More... | |
Constructors & Destructors | |
CompensationTable () | |
Default Constructor. More... | |
CompensationTable (const IMSSystem &iMS) | |
Empty Constructor. More... | |
CompensationTable (int LUTDepth, const MHz &lower_freq, const MHz &upper_freq) | |
CompensationTable (const IMSSystem &iMS, const CompensationPoint &pt) | |
Fill Constructor. More... | |
CompensationTable (int LUTDepth, const MHz &lower_freq, const MHz &upper_freq, const CompensationPoint &pt) | |
CompensationTable (const IMSSystem &iMS, const std::string &fileName) | |
File Read Constructor. More... | |
CompensationTable (int LUTDepth, const MHz &lower_freq, const MHz &upper_freq, const std::string &fileName) | |
CompensationTable (const IMSSystem &iMS, const int entry) | |
Non-volatile Memory Constructor. More... | |
~CompensationTable () | |
Destructor. | |
CompensationTable (const CompensationTable &) | |
Copy Constructor. | |
CompensationTable & | operator= (const CompensationTable &) |
Assignment Constructor. | |
Helper Functions | |
const std::size_t | Size () const |
Returns the Number of Entries in the CompensationTable. More... | |
const MHz | FrequencyAt (const unsigned int index) const |
Returns the frequency represented by a given entry in the CompensationTable. More... | |
![]() | |
void | clear () |
clears the contents More... | |
iterator | insert (iterator pos, const CompensationPoint &value) |
Inserts a single new element into the DequeBase. More... | |
iterator | insert (const_iterator pos, size_t count, const CompensationPoint &value) |
Inserts multiple copies of an element into the DequeBase. | |
iterator | insert (iterator pos, const_iterator first, const_iterator last) |
Inserts a range of elements into the DequeBase. | |
void | push_back (const CompensationPoint &value) |
Appends the given element value to the end of the container. | |
void | pop_back () |
Removes the last element of the container. | |
void | push_front (const CompensationPoint &value) |
Prepends the given element value to the beginning of the container. | |
void | pop_front () |
Removes the first element of the container. | |
iterator | erase (iterator pos) |
Removes the element at pos. | |
iterator | erase (iterator first, iterator last) |
Removes the elements in the range [first; last]. | |
std::size_t | size () const |
Returns the number of elements in the container. | |
DequeBase (const std::string &Name="[no name]", const std::time_t &modified_time=std::time(nullptr)) | |
Create a default empty List with optional name. | |
DequeBase (size_t, const CompensationPoint &, const std::string &Name="[no name]", const std::time_t &modified_time=std::time(nullptr)) | |
Fill Constructor. | |
DequeBase (const_iterator first, const_iterator last, const std::string &Name="[no name]", const std::time_t &modified_time=std::time(nullptr)) | |
Range Constructor. | |
DequeBase (const DequeBase &) | |
Copy Constructor. | |
~DequeBase () | |
Destructor. | |
DequeBase & | operator= (const DequeBase &) |
Assignment Constructor. | |
CompensationPoint & | operator[] (int idx) |
Random Write Access to an element in the Deque. More... | |
const CompensationPoint & | operator[] (int idx) const |
Random Access to an element in the Deque. More... | |
bool | operator== (DequeBase const &rhs) const |
Equality Operator checks Deque object UUID's for equivalence. More... | |
const std::array< std::uint8_t, 16 > | GetUUID () const |
Returns a vector representing the Unique Identifier assigned to the DequeBase object. More... | |
const std::time_t & | ModifiedTime () const |
Returns Time at which the Container was last modified. More... | |
std::string | ModifiedTimeFormat () const |
Returns Human-readable string for the time at which the Container was last modified. More... | |
const std::string & | Name () const |
A string stored with the Container to aid human users in identifying its purpose. More... | |
std::string & | Name () |
iterator | begin () |
Returns an iterator pointing to the first element in the DequeBase container. More... | |
const_iterator | begin () const |
Returns a const_iterator pointing to the first element in the DequeBase container. More... | |
iterator | end () |
Returns an iterator referring to the past-the-end element in the DequeBase container. More... | |
const_iterator | end () const |
Returns a const_iterator referring to the past-the-end element in the DequeBase container. More... | |
const_iterator | cbegin () const |
Returns a const_iterator pointing to the first element in the DequeBase container. More... | |
const_iterator | cend () const |
Returns a const_iterator referring to the past-the-end element in the DequeBase container. More... | |
Additional Inherited Members | |
![]() | |
typedef std::deque< CompensationPoint >::iterator | iterator |
Iterator defined for user manipulation of DequeBase. | |
typedef std::deque< CompensationPoint >::const_iterator | const_iterator |
Const Iterator defined for user readback of DequeBase. | |
A table of CompensationPoints storing look-up data that can be transferred to memory in the Synthesiser.
A CompensationTable always contains a list of CompensationPoints whose length is defined by the available memory depth in an iMS Synthesiser to which the CompensationTable is targetted.
For this reason, a valid IMSSystem object is required to be passed as a const reference to the Constructor because the table will be initialised to the length of the Synthesiser's look-up memory (read from IMSSynthesiser::Capabilities::LUTDepth). Note that a dummy IMSSystem object could also be created with this field set to the LUT depth (in bits, i.e. 12 => 4096 deep LUT). Once the CompensationTable has been constructed, the IMSSystem object is no longer required and may be destroyed.
The length of the CompensationTable cannot be altered after construction.
The CompensationTable can be constructed with all entries initialised to zero, or to a default value. Subsequently, random access is possible for both reading and modifying CompensationPoints, although a faster method for accessing contents is to use the iterators.
Each entry of a CompensationTable has a unique frequency associated with it. Although not part of the table contents itself, it can be readily calculated from the upper and lower frequency bounds of the Synthesiser. A helper function is available to do this calculation.
A CompensationTable may be saved to disk in a '.lut' file. A Constructor also exists to read back from a previously saved .lut file, creating a CompensationTable from the contents of the file.
iMS::CompensationTable::CompensationTable | ( | ) |
Default Constructor.
The default constructor should not normally be used by application code since the length of the table will be left undefined. However it is a required constructor to complete the ImageProject class. If using, the new object should then be assigned from another CompensationTable to ensure that it does not contain dangling pointers
iMS::CompensationTable::CompensationTable | ( | const IMSSystem & | iMS | ) |
Empty Constructor.
An IMSSystem object must be passed by const reference to the CompensationTable constructor in order to determine the correct depth of the LUT memory.
[in] | iMS | the IMSSystem object representing the system the CompensationTable will be constructed for |
iMS::CompensationTable::CompensationTable | ( | int | LUTDepth, |
const MHz & | lower_freq, | ||
const MHz & | upper_freq | ||
) |
This Explicit Empty Constructor makes it possible to create Compensation Tables without being physically connected to an iMS System.
[in] | LUTDepth | the number of entries in the Compensation Look-Up Table |
[in] | lower_freq | the Lowest Frequency reproducible by the Synthesiser |
[in] | upper_freq | the Highest Frequency reproducible by the Synthesiser |
iMS::CompensationTable::CompensationTable | ( | const IMSSystem & | iMS, |
const CompensationPoint & | pt | ||
) |
Fill Constructor.
Use this constructor to preload the CompensationTable with identical values of CompensationPoint
[in] | iMS | the IMSSystem object representing the system the CompensationTable will be constructed for |
[in] | pt | The CompensationPoint that will fill each of the new elements of the CompensationTable |
iMS::CompensationTable::CompensationTable | ( | int | LUTDepth, |
const MHz & | lower_freq, | ||
const MHz & | upper_freq, | ||
const CompensationPoint & | pt | ||
) |
This Explicit Fill Constructor makes it possible to create Compensation Tables without being physically connected to an iMS System.
[in] | LUTDepth | the number of entries in the Compensation Look-Up Table |
[in] | lower_freq | the Lowest Frequency reproducible by the Synthesiser |
[in] | upper_freq | the Highest Frequency reproducible by the Synthesiser |
[in] | pt | The CompensationPoint that will fill each of the new elements of the CompensationTable |
iMS::CompensationTable::CompensationTable | ( | const IMSSystem & | iMS, |
const std::string & | fileName | ||
) |
File Read Constructor.
Use this constructor to preload the CompensationTable with data read in from a file on disk
[in] | iMS | the IMSSystem object representing the system the CompensationTable will be constructed for |
[in] | fileName | A string pointing to a '*.lut' file on the filesystem containing preexisting CompensationTable data |
iMS::CompensationTable::CompensationTable | ( | int | LUTDepth, |
const MHz & | lower_freq, | ||
const MHz & | upper_freq, | ||
const std::string & | fileName | ||
) |
This Explicit File Read Constructor makes it possible to create Compensation Tables without being physically connected to an iMS System.
[in] | LUTDepth | the number of entries in the Compensation Look-Up Table |
[in] | lower_freq | the Lowest Frequency reproducible by the Synthesiser |
[in] | upper_freq | the Highest Frequency reproducible by the Synthesiser |
[in] | fileName | A string pointing to a '*.lut' file on the filesystem containing preexisting |
iMS::CompensationTable::CompensationTable | ( | const IMSSystem & | iMS, |
const int | entry | ||
) |
Non-volatile Memory Constructor.
Use this constructor to preload the CompensationTable with data recalled from an entry in the Synthesiser FileSystem.
[in] | iMS | the IMSSystem object representing the system the CompensationTable will be constructed for |
[in] | entry | the entry in the FileSystem Table from which to recall a Compensation Table CompensationTable data |
const MHz iMS::CompensationTable::FrequencyAt | ( | const unsigned int | index | ) | const |
Returns the frequency represented by a given entry in the CompensationTable.
Each entry in the CompensationTable has an implied frequency at which it will become active.
[in] | index | The CompensationTable entry to retrieve the associated Frequency for |
const bool iMS::CompensationTable::Save | ( | const std::string & | fileName | ) | const |
Save Table contents to file using latest protocol version.
The contents of this CompensationTable can be saved to disk for retrieval at a later time. Calling this function will write out the contents of the table to a file which is opened at the filesystem location given by the string fileName.
If the function cannot create the file, it will not save the table, and return false.
fileName can be any valid filesystem location and any name, but we recommend the use of the file extension '.lut'
[in] | fileName | the name and location of the file to write CompensationTable data to |
const std::size_t iMS::CompensationTable::Size | ( | ) | const |
Returns the Number of Entries in the CompensationTable.