advanced index counter for samplers
Posted: Wed Sep 10, 2014 10:38 pm
This is an advanced index counter for samplers, with a sampler as an example.
The Clock Core has 3 internal clocks, that can calculate 3separate sections of indexes. First clock counts the most recent section and rest two calculate previous sections during crossfades.
The clock core receives several parameters that define a clock:
Section start point (32bit integer - converters are inside the schematic)
Section end point (also 32bit int)
+both also receive a fractional part, so you can define a section with subsample precision
crossfade length
direction (forward or backward playback)
and "play" boolean which suppose to be a pulse, that initiates the clock.
When you initialize new clock, old clock 0 is moved to clock above (the clock 1) and continues to calculate until the crossfade is finished (this can by stacked twice, allowing 2crossfades ad the same time for example when "release" is hit during loop crossfade). Clocks 1 and 2 have also gain output (for crossfade calculations) which is a falling ramp and stop calculating after zero is reached.
The clocks continue to calculate even if the index leave start/end boundaries. You get notified about such event in clock 0 by the "finished" boolean output which becomes true when index will step outside the section boundaries (you get notified one sample in advance, so when connected in feedback your loop/ADSR section calculator can react in next sample).
I think my description above is not very clear, but I will write complete clear manual once I finish several features and optimizations. Until then, here is an example schematic. You can load a wave file, define 3 sections in the file and define crossfade lengths. First section (named attack) is played when you hit the note, once it finishes, it crossfades to the middle section (named looped sustain). The middle section is looped while holding the note (also with definable crossfade). When you release the note, sound crossfades to the last "release" section (note that this also works during attack and when crossfade is already happening). The schematic also indicates the index positions for the 3 clocks by lines (notice that you see two lines during crossfades or even 3 lines when you need to crossfade during crossfade).
The Clock Core has 3 internal clocks, that can calculate 3separate sections of indexes. First clock counts the most recent section and rest two calculate previous sections during crossfades.
The clock core receives several parameters that define a clock:
Section start point (32bit integer - converters are inside the schematic)
Section end point (also 32bit int)
+both also receive a fractional part, so you can define a section with subsample precision
crossfade length
direction (forward or backward playback)
and "play" boolean which suppose to be a pulse, that initiates the clock.
When you initialize new clock, old clock 0 is moved to clock above (the clock 1) and continues to calculate until the crossfade is finished (this can by stacked twice, allowing 2crossfades ad the same time for example when "release" is hit during loop crossfade). Clocks 1 and 2 have also gain output (for crossfade calculations) which is a falling ramp and stop calculating after zero is reached.
The clocks continue to calculate even if the index leave start/end boundaries. You get notified about such event in clock 0 by the "finished" boolean output which becomes true when index will step outside the section boundaries (you get notified one sample in advance, so when connected in feedback your loop/ADSR section calculator can react in next sample).
I think my description above is not very clear, but I will write complete clear manual once I finish several features and optimizations. Until then, here is an example schematic. You can load a wave file, define 3 sections in the file and define crossfade lengths. First section (named attack) is played when you hit the note, once it finishes, it crossfades to the middle section (named looped sustain). The middle section is looped while holding the note (also with definable crossfade). When you release the note, sound crossfades to the last "release" section (note that this also works during attack and when crossfade is already happening). The schematic also indicates the index positions for the 3 clocks by lines (notice that you see two lines during crossfades or even 3 lines when you need to crossfade during crossfade).