Nsound Circular Iterators

Spread the love

On the Nsound development branch, I’ve exposed the C++ circular iterators for the Buffer class to the Python module.  This code will eventually get released as part of Nsound-0.9.3.

Here’s how one might use them:

Which will produce the this output:

The function cbegin() returns a Buffer::circular_iterator object that can be dereferenced using the Python builtin float(). The iterator can be incremented using the += operator. Once the iterator goes off the end of the Buffer, it wraps around back to the beginning again, circular.

This entry was posted in nsound. Bookmark the permalink.