Peter de Jong Attractor: Bgrabmp Colouring Help Needed ? lazarus / 39-Graphics ---------------------------------------------------------------------- Boleeman · 2025-04-16 08:19 I made a Lazarus program that creates Peter de Jong Attractors. I am trying to get a smooth high coloured rainbow effect like at https://richardrosenman.com/shop/peter-de-jong-attractor/ I used a TBgrabmap for the rendering but have been struggling to get a high coloured rendering." Up to version 4, after making a basic rendering and then extending it. ---------------------------------------------------------------------- Thaddy · 2025-04-16 12:14 Wow. Made me think to apply it to audio: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit PeterDeJongAttractor;{$mode objfpc}interface uses  Math, Types;type  TDoublePoint = record    X, Y: Double;    constructor Create(AX, AY: Double);  end; constructor TDoublePoint.Create(AX, AY: Double);begin  X := AX;  Y := AY;end;   TPDJAttractor = class  private    Fx, Fy: Double;    FParamA, FParamB, FParamC, FParamD: Double;  public    constructor Create(a, b, c, d: Double);    /// Returns the next point in the attractor sequence    function Iterate: TDoublePoint;inline;  /// Reset to initial state (optional)    procedure Reset;inline;  end; implementation constructor TPDJAttractor.Create(a, b, c, d: Double);begin  FParamA := a;  FParamB := b;  FParamC := c;  FParamD := d;  Fx := 0;  Fy := 0;end; function TPDJAttractor.Iterate: TDoublePoint;var  newX, newY: Double;begin  newX := Sin(FParamA * Fy) - Cos(FParamB * Fx);  newY := Sin(FParamC * Fx) - Cos(FParamD * Fy);  Fx := newX;  Fy := newY;  Result := TDoublePoint.Create(newX, newY);end; procedure TPDJAttractor.Reset;begin  Fx := 0;  Fy := 0;end; end.Then:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TMyVSTModule.ProcessAudioBlock(Buffer: PSingle; SampleCount: Integer);var  i: Integer;  AttractorPoint: TDoublePoint;  ModulationValue: Single;begin  for i := 0 to SampleCount - 1 do  begin    // Retrieve the current attractor values (could be at a slower modulation rate)    AttractorPoint := FMyAttractor.Iterate;    // Map the output to a useful modulation range. For example, normalize and scale:    ModulationValue := (CSng(AttractorPoint.X) + 2) / 4; // maps from [-2,2] to [0,1]        // Use ModulationValue to influence a parameter in your DSP code:    // For example, adjust oscillator frequency, filter cutoff, etc.    ApplyModulationToYourDSP(ModulationValue);     // Continue processing audio...    Buffer[i] := ProcessSample(Buffer[i]);  end;end;I think I have a VST to write....This is just a scetch. You can probably also use this simple unit for your graphics purpose. ---------------------------------------------------------------------- Boleeman · 2025-04-16 23:44 Wondered how that audio version would sound ? There are lots of graphic versions about , written in other languages but never thought of audio versions.