audioeffects.phaser
Phaser - four first-order all-pass stages swept the way a Phase 90 is.
The player’s text is the class docstring; the CLAIMS table in the class’s
test file ties its claim sentences to tests.
- audioeffects.phaser.FB_FLOOR_HZ = 141.1
pinch-off f_b with R5 = 24 kΩ, C2 = 47 nF.
- Type:
Appendix A
- audioeffects.phaser.TAN_22_5 = 0.41421356237309503
notch 1 sits here relative to a stage’s f_b.
- Type:
tan(22.5°)
- audioeffects.phaser.HALF_SWING_HZ = 1334.85
Half the S3 typical-unit Hertz swing (328.0 … 2997.7 Hz) at Depth 1.
- audioeffects.phaser.CURVE_SCALE = 0.666666667
What the table’s full scale stands for. The curve is normalised to its own extreme so it fills int16 (audiocomponents#77) and this carries the scale back out in the shaper’s
post_gain.
- audioeffects.phaser.CUBIC_CURVE = array('h', [-32767, -32767, -32766, -32765, -32764, -32762, -32760, -32758, -32755, -32752, -32748, -32744, -32740, -32736, -32731, -32725, -32719, -32713, -32707, -32700, -32693, -32685, -32677, -32669, -32660, -32651, -32642, -32632, -32622, -32612, -32601, -32590, -32579, -32567, -32555, -32542, -32529, -32516, -32502, -32489, -32474, -32460, -32445, -32429, -32414, -32398, -32381, -32365, -32348, -32330, -32313, -32295, -32276, -32258, -32238, -32219, -32199, -32179, -32159, -32138, -32117, -32096, -32074, -32052, -32030, -32007, -31984, -31961, -31937, -31913, -31888, -31864, -31839, -31814, -31788, -31762, -31736, -31709, -31682, -31655, -31627, -31600, -31571, -31543, -31514, -31485, -31455, -31426, -31396, -31365, -31335, -31304, -31272, -31241, -31209, -31177, -31144, -31111, -31078, -31045, -31011, -30977, -30942, -30908, -30873, -30838, -30802, -30766, -30730, -30694, -30657, -30620, -30582, -30545, -30507, -30469, -30430, -30391, -30352, -30313, -30273, -30233, -30193, -30153, -30112, -30071, -30029, -29988, -29946, -29904, -29861, -29818, -29775, -29732, -29688, -29644, -29600, -29556, -29511, -29466, -29421, -29375, -29330, -29283, -29237, -29190, -29144, -29096, -29049, -29001, -28953, -28905, -28857, -28808, -28759, -28710, -28660, -28610, -28560, -28510, -28459, -28408, -28357, -28306, -28254, -28202, -28150, -28098, -28045, -27992, -27939, -27886, -27832, -27778, -27724, -27670, -27615, -27560, -27505, -27450, -27394, -27338, -27282, -27226, -27169, -27113, -27056, -26998, -26941, -26883, -26825, -26767, -26708, -26649, -26591, -26531, -26472, -26412, -26352, -26292, -26232, -26171, -26111, -26050, -25988, -25927, -25865, -25803, -25741, -25679, -25616, -25553, -25490, -25427, -25364, -25300, -25236, -25172, -25107, -25043, -24978, -24913, -24848, -24782, -24717, -24651, -24585, -24519, -24452, -24386, -24319, -24252, -24184, -24117, -24049, -23981, -23913, -23845, -23776, -23708, -23639, -23569, -23500, -23431, -23361, -23291, -23221, -23151, -23080, -23009, -22939, -22868, -22796, -22725, -22653, -22581, -22509, -22437, -22365, -22292, -22219, -22146, -22073, -22000, -21926, -21853, -21779, -21705, -21631, -21556, -21482, -21407, -21332, -21257, -21182, -21106, -21030, -20955, -20879, -20802, -20726, -20650, -20573, -20496, -20419, -20342, -20265, -20187, -20110, -20032, -19954, -19876, -19797, -19719, -19640, -19561, -19482, -19403, -19324, -19245, -19165, -19085, -19005, -18925, -18845, -18765, -18684, -18604, -18523, -18442, -18361, -18279, -18198, -18117, -18035, -17953, -17871, -17789, -17707, -17624, -17542, -17459, -17376, -17293, -17210, -17127, -17043, -16960, -16876, -16792, -16709, -16624, -16540, -16456, -16371, -16287, -16202, -16117, -16032, -15947, -15862, -15777, -15691, -15606, -15520, -15434, -15348, -15262, -15176, -15089, -15003, -14916, -14830, -14743, -14656, -14569, -14482, -14395, -14307, -14220, -14132, -14044, -13957, -13869, -13781, -13692, -13604, -13516, -13427, -13339, -13250, -13161, -13072, -12983, -12894, -12805, -12716, -12626, -12537, -12447, -12358, -12268, -12178, -12088, -11998, -11908, -11817, -11727, -11637, -11546, -11455, -11365, -11274, -11183, -11092, -11001, -10910, -10819, -10727, -10636, -10544, -10453, -10361, -10269, -10178, -10086, -9994, -9902, -9810, -9717, -9625, -9533, -9440, -9348, -9255, -9163, -9070, -8977, -8884, -8792, -8699, -8605, -8512, -8419, -8326, -8233, -8139, -8046, -7952, -7859, -7765, -7671, -7578, -7484, -7390, -7296, -7202, -7108, -7014, -6920, -6826, -6732, -6637, -6543, -6448, -6354, -6260, -6165, -6070, -5976, -5881, -5786, -5692, -5597, -5502, -5407, -5312, -5217, -5122, -5027, -4932, -4837, -4742, -4646, -4551, -4456, -4361, -4265, -4170, -4074, -3979, -3884, -3788, -3693, -3597, -3501, -3406, -3310, -3214, -3119, -3023, -2927, -2832, -2736, -2640, -2544, -2448, -2352, -2257, -2161, -2065, -1969, -1873, -1777, -1681, -1585, -1489, -1393, -1297, -1201, -1105, -1009, -913, -817, -721, -625, -528, -432, -336, -240, -144, -48, 48, 144, 240, 336, 432, 528, 625, 721, 817, 913, 1009, 1105, 1201, 1297, 1393, 1489, 1585, 1681, 1777, 1873, 1969, 2065, 2161, 2257, 2352, 2448, 2544, 2640, 2736, 2832, 2927, 3023, 3119, 3214, 3310, 3406, 3501, 3597, 3693, 3788, 3884, 3979, 4074, 4170, 4265, 4361, 4456, 4551, 4646, 4742, 4837, 4932, 5027, 5122, 5217, 5312, 5407, 5502, 5597, 5692, 5786, 5881, 5976, 6070, 6165, 6260, 6354, 6448, 6543, 6637, 6732, 6826, 6920, 7014, 7108, 7202, 7296, 7390, 7484, 7578, 7671, 7765, 7859, 7952, 8046, 8139, 8233, 8326, 8419, 8512, 8605, 8699, 8792, 8884, 8977, 9070, 9163, 9255, 9348, 9440, 9533, 9625, 9717, 9810, 9902, 9994, 10086, 10178, 10269, 10361, 10453, 10544, 10636, 10727, 10819, 10910, 11001, 11092, 11183, 11274, 11365, 11455, 11546, 11637, 11727, 11817, 11908, 11998, 12088, 12178, 12268, 12358, 12447, 12537, 12626, 12716, 12805, 12894, 12983, 13072, 13161, 13250, 13339, 13427, 13516, 13604, 13692, 13781, 13869, 13957, 14044, 14132, 14220, 14307, 14395, 14482, 14569, 14656, 14743, 14830, 14916, 15003, 15089, 15176, 15262, 15348, 15434, 15520, 15606, 15691, 15777, 15862, 15947, 16032, 16117, 16202, 16287, 16371, 16456, 16540, 16624, 16709, 16792, 16876, 16960, 17043, 17127, 17210, 17293, 17376, 17459, 17542, 17624, 17707, 17789, 17871, 17953, 18035, 18117, 18198, 18279, 18361, 18442, 18523, 18604, 18684, 18765, 18845, 18925, 19005, 19085, 19165, 19245, 19324, 19403, 19482, 19561, 19640, 19719, 19797, 19876, 19954, 20032, 20110, 20187, 20265, 20342, 20419, 20496, 20573, 20650, 20726, 20802, 20879, 20955, 21030, 21106, 21182, 21257, 21332, 21407, 21482, 21556, 21631, 21705, 21779, 21853, 21926, 22000, 22073, 22146, 22219, 22292, 22365, 22437, 22509, 22581, 22653, 22725, 22796, 22868, 22939, 23009, 23080, 23151, 23221, 23291, 23361, 23431, 23500, 23569, 23639, 23708, 23776, 23845, 23913, 23981, 24049, 24117, 24184, 24252, 24319, 24386, 24452, 24519, 24585, 24651, 24717, 24782, 24848, 24913, 24978, 25043, 25107, 25172, 25236, 25300, 25364, 25427, 25490, 25553, 25616, 25679, 25741, 25803, 25865, 25927, 25988, 26050, 26111, 26171, 26232, 26292, 26352, 26412, 26472, 26531, 26591, 26649, 26708, 26767, 26825, 26883, 26941, 26998, 27056, 27113, 27169, 27226, 27282, 27338, 27394, 27450, 27505, 27560, 27615, 27670, 27724, 27778, 27832, 27886, 27939, 27992, 28045, 28098, 28150, 28202, 28254, 28306, 28357, 28408, 28459, 28510, 28560, 28610, 28660, 28710, 28759, 28808, 28857, 28905, 28953, 29001, 29049, 29096, 29144, 29190, 29237, 29283, 29330, 29375, 29421, 29466, 29511, 29556, 29600, 29644, 29688, 29732, 29775, 29818, 29861, 29904, 29946, 29988, 30029, 30071, 30112, 30153, 30193, 30233, 30273, 30313, 30352, 30391, 30430, 30469, 30507, 30545, 30582, 30620, 30657, 30694, 30730, 30766, 30802, 30838, 30873, 30908, 30942, 30977, 31011, 31045, 31078, 31111, 31144, 31177, 31209, 31241, 31272, 31304, 31335, 31365, 31396, 31426, 31455, 31485, 31514, 31543, 31571, 31600, 31627, 31655, 31682, 31709, 31736, 31762, 31788, 31814, 31839, 31864, 31888, 31913, 31937, 31961, 31984, 32007, 32030, 32052, 32074, 32096, 32117, 32138, 32159, 32179, 32199, 32219, 32238, 32258, 32276, 32295, 32313, 32330, 32348, 32365, 32381, 32398, 32414, 32429, 32445, 32460, 32474, 32489, 32502, 32516, 32529, 32542, 32555, 32567, 32579, 32590, 32601, 32612, 32622, 32632, 32642, 32651, 32660, 32669, 32677, 32685, 32693, 32700, 32707, 32713, 32719, 32725, 32731, 32736, 32740, 32744, 32748, 32752, 32755, 32758, 32760, 32762, 32764, 32765, 32766, 32767, 32767])
Drive’s soft clip,
y = x - x**3 / 3, normalised so the table fills int16. Generated bytools/curves/phaser_curve.py;CURVE_SCALEabove is what its full scale stands for and the class carries it in the shaper’spost_gain, so the level is exactly where it was.
- class audioeffects.phaser.Phaser(source, *options, **keywords)[source]
Bases:
ComponentA phaser after the Phase 90: notches swept up and down your signal on a triangle.
Controls. Rate is the sweep’s speed, and at 0 the notches hold still. Depth is how far they swing, and Centre puts the lower notch, mid-sweep. Stages sets how many all-pass stages there are, and each pair makes a notch: four stages make two, the second about two and a half octaves above the first. Mix at 0 is your dry signal, and at 0.5, the default, the notches go deeper than 40 dB. Feedback lifts a hump between the notches. Shape leans the triangle. Drive softens the signal on its way into the stages, so it grows harmonics as your level rises. The Effect controls page lists what the knobs span.
Drive and Feedback. Drive is 0.3 when you construct the class, and there the Feedback hump stays under 5 dB. Turn Drive to 0 and Feedback lifts it more than 5 dB. The Phaser - lean patch is the default with Drive at 0. Keep the input under -9 dBFS and the defaults and patches stay off the rails. Feedback at its top can still push the output onto the rails.
Sync. With Sync on, the sweep locks to the host: Division picks the length of a sweep in bars, a bar is read from the host’s time signature, and a change of tempo or meter is followed.
Timing. Latency is zero at every setting. Silence in is silence out once the notches ring down, which at musical settings is quick; the class reports the worst case, 552960 samples, for stages at their sharpest.
On a board. The class needs audiodsp’s
audiobiquadandaudioshaper, and on a board without them construction raisesImportError.- NAME = 'Phaser'
The stable provider name
audioeffects.create()discovers.
- TIER = 'audiodsp'
STOCK or AUDIODSP, with REQUIRES naming the audiodsp-own modules an AUDIODSP class needs.
- Type:
roadmap §3
- CAPABILITIES = ('tempo_sync',)
The contract’s static reads.
CAPABILITIESnames"tempo_sync"if and only if the class readsself._transport().
- TAIL_SAMPLES = 552960
Worst-case first-order all-pass flush at the coefficient cap (
AUDIODSP_FILTER_F32_MAX_ALLPASS_C) is ~550_000 samples in the C comment; musical settings die much sooner. Ceiling, next 2048.
- INPUT_CEILING_DBFS = -9
The defaults and every patch play the ceiling kit’s materials clean at this level; at -6 dBFS, patch 1 rails on a 147 Hz square.
- CLIPS_AT_TOP = (3,)
the rail check skips them.
- Type:
Settings that clip by design
- MACRO_LABELS = ('Rate', 'Depth', 'Centre', 'Feedback', 'Mix', 'Stages', 'Shape', 'Drive', 'Sync', 'Division')
Knob names, one per macro index; one mode per label; the private engineering spans behind them; and the patches on the 0-127 grid.
- reset()[source]
Clear every node, restore patch 0 and start the sweep again.
The sweep is a
synthio.LFOthe walk does not reach, so it ran on through a reset from wherever it was; patch 0 now builds a fresh one, which starts where a fresh instance’s does, as Vibrato’s does on its clear.