CommandoAir Posted November 29, 2015 Share Posted November 29, 2015 Bit of a strange one, but here goes my first post. I did a quick search and haven't been able to find one, but is there a plug-in or method that will allow me to create a kind of waveform (like a sine wave sort of) where the "frequency" gradually gets longer/shorter? I could try doing it by hand, but it would irritate me like an itch knowing that it's not perfect, even if I got it to look good. This is a quick drawing of what I'm kind of after: A bit rough, just a quick scribble to get the idea across. So any ideas how to achieve this kind of pattern? Quote Link to comment Share on other sites More sharing options...
BoltBait Posted November 29, 2015 Share Posted November 29, 2015 Maybe this one? http://forums.getpaint.net/index.php?/topic/7647- If not, maybe the author could help you out. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted November 29, 2015 Share Posted November 29, 2015 Or maybe this one: Sound Wave Edit: maybe not. I was thinking of something else. 1 Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
nitenurse79 Posted November 29, 2015 Share Posted November 29, 2015 Or maybe this one: Sound Wave Edit: maybe not. I was thinking of something else. WEOAMP Quote Link to comment Share on other sites More sharing options...
BoltBait Posted November 29, 2015 Share Posted November 29, 2015 I remember there is a plugin where you can enter a formula and it will plot it. I can't remember what it is called though. Anyone else remember? Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Red ochre Posted November 29, 2015 Share Posted November 29, 2015 'Equations' in Curtis' Pack? http://forums.getpaint.net/index.php?showtopic=8043 My 'Helix' can vary amplitude but not wave length. Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
racerx Posted November 29, 2015 Share Posted November 29, 2015 (edited) In PDN, I also recommend Sine curves plugin. There are free tools out there that can generate sine waves from an audio file while it plays. Here is an example, the song is "Another one bites the dust" by Queen. Edited November 29, 2015 by racerx Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted November 29, 2015 Share Posted November 29, 2015 Or maybe this one: Sound Wave Edit: maybe not. I was thinking of something else. Was thinking of Ed Harvey's Seismograph WEOAMP Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
CommandoAir Posted November 30, 2015 Author Share Posted November 30, 2015 Maybe this one? http://forums.getpaint.net/index.php?/topic/7647- If not, maybe the author could help you out. This looks like what I want, but the download link is broken Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted December 1, 2015 Share Posted December 1, 2015 This looks like what I want, but the download link is broken The Sine Curves plugin is still available in Madjik's plugin pack. http://forums.getpaint.net/index.php?showtopic=7186 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
CommandoAir Posted December 1, 2015 Author Share Posted December 1, 2015 The Sine Curves plugin is still available in Madjik's plugin pack. http://forums.getpaint.net/index.php?showtopic=7186 Thanks Quote Link to comment Share on other sites More sharing options...
MJW Posted December 1, 2015 Share Posted December 1, 2015 I don't see where the Sine Curves plugin allows variable frequency. Quote Link to comment Share on other sites More sharing options...
Red ochre Posted December 1, 2015 Share Posted December 1, 2015 Rotate and zoom afterwards perhaps? Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
MJW Posted December 2, 2015 Share Posted December 2, 2015 This sounds like a interesting and fairly easy plugin to write, so I'll give it a try. It won't be too fancy. 1 Quote Link to comment Share on other sites More sharing options...
Red ochre Posted December 2, 2015 Share Posted December 2, 2015 ^Probably the best soloution! I hope 'Commando air' is still watching the forum but sure other users will benefit! Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
MJW Posted December 2, 2015 Share Posted December 2, 2015 (edited) Here's my plugin: GraphSine.zip It's under Effects>Render>Graph Sine. The Help menu is just a stub which I'll probably improve. It draws in the Primary Color on a Secondary Color background. I haven't updated CodeLab yet, so it uses two place precision on the slider (which is probably enough). Here's the source: Hidden Content: // Name: Graph Sine // Submenu: Render // Author: MJW // Title: Graph Sine // Desc: Graph a variable-frequency sine wave // Keywords: graph sine // URL: // Help: [b]Graph Sine[/b] graphs a sine wave whose frequency can vary from the beginning to the end. The size is adjusted to fill the current selection. #region UICode DoubleSliderControl Amount1 = 1; // [0.01,100] Beginning Frequency DoubleSliderControl Amount2 = 1; // [0.01,100] Ending Frequency DoubleSliderControl Amount3 = 1; // [0,4] Amplitude DoubleSliderControl Amount4 = 0; // [-1,1] Phase (in cycles relative to beginning frquency) DoubleSliderControl Amount5 = 1; //[1,10] Line Thickness. CheckboxControl Amount6 = false; //[0,1] Overwrite #endregion DoubleSliderControl prevAmount1 = -1; DoubleSliderControl prevAmount2 = -1; DoubleSliderControl prevAmount3 = -1; DoubleSliderControl prevAmount4 = -1; Point[] function = null; int xSteps; void Render(Surface dst, Surface src, Rectangle rect) { Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); if (function == null) { xSteps = sel.Width; function = new Point[xSteps]; prevAmount1 = Amount3 - 1.0; } // If any of the controls which affect the graph change, update the graph. if ((prevAmount1 != Amount1) || (prevAmount2 != Amount2) || (prevAmount3 != Amount3) || (prevAmount4 != Amount4)) { prevAmount1 = Amount1; prevAmount2 = Amount2; prevAmount3 = Amount3; prevAmount4 = Amount4; // t will go from 0 to 1 across the selection. double tStep = 1.0 / (double)(xSteps - 1); double xScreenScale = (double)(sel.Width - 1); double xScreenOffset = (double)sel.Left; double yLow = -1.0; double yHigh = 1.0; double yRange = yHigh - yLow; double yScreenScale = -(double)(sel.Height - 1) / yRange; double yScreenOffset = (double)sel.Top - yScreenScale * yHigh; double aScale = 2.0 * Math.PI; double aOffset = -Amount4 * aScale / Amount1; double fScale = Amount2 - Amount1; double fOffset = Amount1; double t = 0.0; for (int i = 0; i < xSteps; i++) { double f = fScale * t + fOffset; double a = aScale * t + aOffset; int screenX = (int)(xScreenScale * t + xScreenOffset + 0.5); double y = Amount3 * Math.Sin(f * a); //y = 0.1 * a * f; int screenY = (int)(yScreenScale * y + yScreenOffset + 0.5); function[i] = new Point(screenX, screenY); t += tStep; } } // Clear the ROI or copy it. if (Amount6) dst.CopySurface(src, rect.Location, rect); else dst.Clear(rect, EnvironmentParameters.SecondaryColor); // Create a pen to draw with and a graphics object to draw on. // Then draw the graph. using (Pen myPen = new Pen(EnvironmentParameters.PrimaryColor)) using (Graphics g = new RenderArgs(dst).Graphics) { myPen.Width = (float)Amount5; g.Clip = new Region(rect); // Set the smoothness mode. g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; // Now draw the function. g.DrawLines(myPen, function); } } EDIT: I will, of course, consider suggestions for improvements, though I hope I don't have to spend too much time on this plugin. EDIT2: Fixed bug that resulted from a mistake I made when renumbering the Amount variables. The problem might not be noticeable, but it could cause the graph not to update when it should, or it could cause the plugin to run slower. I'm considering redesigning the algorithm. I go to considerable effort to avoid recalculating the graph for each ROI. It may not be worth it. It would probably run fast enough without the complexity. EDIT3: I think I'll keep the algorithm as it is. "Considerable effort" is an overstatement. It's really just a matter of keeping track of whether any of the controls that affect the graph have changed since the graph was last computed. Edited December 3, 2015 by MJW 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.