Stack and Queue

Containers

(9 Votes)
Colugo _
1.0 (Updated 8 years ago)
527.4kB
December 11, 2016
Reaktor 6

DESCRIPTION

LIFO stack and FIFO queue macros + a library for developing additional stack and queue operations. Both containers include the ability to save/load data from snapshots.

See the info texts for documentation.

The containers are both implemented as circular buffers. This allows us to, for example, erase elements from the bottom of a stack by just moving the marker upwards, without the need for iteration.

Included operations:
Push
Pop
Peek
Erase Bottom (Stack)
Erase Top (Stack)
Erase Back (Queue)
Erase Front (Queue)

*note* If you are creating your own algorithms and have the snapshot ports hooked up, the internal markers can sometimes get messed up during development. Reset buttons are provided inside the 'Stack Snap Store' and 'Queue Snap Store' primary macros which reset the markers back to zero.

COMMENTS  (6)

Colin Brown
1 month ago
One example might be a sequencer in core. You want to output midi. Sometimes one particular action might need to output multiple midi messages, but core processing is simultaneous, so you need to stick those messages in a buffer, then empty it using some external clock. That would be a FIFO.
michael o'hagan
1 month ago
O don't understand what these are for, but I am intensely curious...
Richard Cocksedge
6 years ago
Just want to say thanks, I am studying this intently. Love the stuff you do!
Colugo _
8 years ago
Thanks for the feedback Mark. I tried to make sure the main two macros were fully documented but some of the other tooltips are still lacking. I'll upload a new version once I fill in the gaps. The third row lists the "implementation" macros which are used to implement the main operations. e.g. 'Push Top' pushes a value onto the stack but it doesn't do any error checking. The 'Push' macro on the 2nd row is just 'Push Top' with added error checking.
Mark Wadewitz
8 years ago
This is absolutely awesome and looks very, very professional! Five stars plus five extra ones from me. Some tool tips are missed (i.e. erase macros) and some other´s could be more precise (those on the lower rows of stack and queue, i.e. writer, reader, push top/back, pop top/front, etc.). Not 100% clear to me what those macros do or what the difference to the related ones in the second rows is. But what heck, GREAT WORK!
herw
8 years ago
cool
now