Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
MIDI Buffer Pivot Command
The Buffer Pivot (BP) command allows a MIDI Changes script to modify a section of an input buffer by using the first note of the specified source section as a reference, then pivoting the remaining notes about that reference and copying to the destination.
For example, if the source section holds MIDI notes 60, 62, 57, and 61 then the reference would be 60. 62 is 2 higher than 60, so it pivots down to 2 lower than 60 to become 58. 57 is 3 lower, so it becomes 3 higher... 63. 61 becomes 59, making the final sequence 60, 58, 63, 59.
You might want to use Buffer Pivot on the last few notes of a longer sequence. You would typically play the original sequence through a couple of times or more, then play the pivoted version as an interesting variant, then return to the original. (Giving the same Pivot command again will reverse the changes.)
The format for Buffer Pivot is BPvb.i0=vb(i1,i2), where the left side refers to destination buffer and the right to the source. (Typically these are the same.) v is Voice number 1-8, and b is buffer number 1-4. i0 is the index (position) where the pivoted copy should start in the destination buffer, and (i1,i2) are the start and end positions in the source buffer. i1 is the pivot reference note and is unchanged.
If i1 is greater than i2 then the pivot process still uses i1 as the reference, but it operates from high to low index positions. The i1 source value is copied to the i0 destination position, followed by the pivoted notes in high to low sequence. Thus, the destination notes are not only pivoted, but also reversed in order.
Positions i0, i1, and i2 may use any unsigned integer or valid expression, including current MIDI control values, random values, current computer keyboard states or mouse position, input or buffered notes, oscillators, and User Variables. Values will be limited to the 0-255 buffer position range.
Buffer Pivot may not be used with live input (buffer 0).
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
Over 35 Years of Innovative Instrumentation
© Copyright 2007 - 2022 by Interstellar Research
All rights reserved