Skip to content

Commit

Permalink
Merge pull request #2 from TheArmagan/master
Browse files Browse the repository at this point in the history
ortada değil ama çok renkli falan bide şey bass falan gelince böyle h…
  • Loading branch information
TheAlan404 authored Jan 14, 2022
2 parents 7065302 + a0c0f0f commit 3c478d3
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions DenVis/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/// TW: SHITCODE AHEAD
im sorry -dennis
im sorry -dennis also thearmagan
*/

Expand Down Expand Up @@ -115,7 +115,7 @@ public static void Render(object _, DrawGraphicsEventArgs e)
float[] data = new float[(int)fftSize];

fftProvider.GetFftData(data);
float [] dataPart = new ArraySegment<float>(data, 0, screenW).ToArray();
float [] dataPart = new ArraySegment<float>(data, 0, screenW/2).ToArray();


// azıcık olan c# bilgim yetmedi
Expand All @@ -139,14 +139,16 @@ public static void Render(object _, DrawGraphicsEventArgs e)
//k /= 50;
//Console.WriteLine(k);

if (dataPart.Max() < 0.001) Array.Fill(dataPart, 0f);
//if (dataPart.Max() < 0.001) Array.Fill(dataPart, 0f);




dataPart = Normalize(dataPart);

StringBuilder sb = new StringBuilder();




float bassSum = 0;
for (int i = 0; i < 16; i++)
Expand All @@ -157,18 +159,19 @@ public static void Render(object _, DrawGraphicsEventArgs e)
bassSum /= 16;




float[] yarısı = new ArraySegment<float>(dataPart,0,(int)(screenW/4)).ToArray();
float[] centered = yarısı.Reverse().Concat(yarısı).ToArray();



float previousValue = 0f;
float xPosition = pointDistance;

float ij = 0;
foreach(float value in dataPart)
{
ij++;
for (int i = 0; i < centered.Length; i++)
{
float value = centered[i];

value += bassSum;
gfx.DrawLine(Brush,
// start x
xPosition - pointDistance,
Expand All @@ -189,13 +192,14 @@ public static void Render(object _, DrawGraphicsEventArgs e)
//lastHue += 0.001;

if (lastHue > 1) lastHue = lastHue % 1;
lastHue += 0.001;
System.Drawing.Color c = ColorScale.ColorFromHSL(lastHue, 0.5, 0.5);


Brush.Color = new Color(c.R, c.G, c.B);


xPosition += pointDistance;

xPosition += pointDistance;
previousValue = value;
}

Expand Down

0 comments on commit 3c478d3

Please sign in to comment.