Making a perfect sine wave and animating it

How hard can it be to draw a perfect sine wave using Photoshop, Illustrator, After Effects, or Apple Motion? Turns out it's harder than you might think. But there's a way of doing it that doesn't need any of these softwares. The result is beautifully mathematically perfect. And then you can animate it in Final Cut Pro X or any pro video editing software. Let's go...
Automated transcript
If you hear any background noise it's because I've got the window open because my computer is checking out 400 watts of heat and it's darn hot in here what I'm going to do is I'm going to create a perfect sine wave and I'm going to animate it it looks like this
so my starting point for this exercise was how do I create a perfect sine wave I thought well why create one when I can possibly find one that I can use so let's go on Google there we've got some sine waves let's go on to the image search and see what we've got so that looks a bit like a sine wave but it looks hand-drawn doesn't it and that doesn't look any better this one looks like a good sine wave I would say but it's got the axes in and I don't want that and I know yes I could arrays the axes but there's always a problem when you come to these crossovers here it's quite difficult to erase something and then you have to put a little bit of the signal back in again sounds like a construction site outside but never mind I'm going to press on so that doesn't really work very well for me that's good but it's got the grid on it so that is just one cycle getting better getting better wonky what I'm saying here is that it's difficult to find a sine wave that does look like one so let's just have a look here it doesn't look bad I'm going to download the PNG so here we have it in Photoshop and it looks plausible but let's zoom in you see it's got these two color effects and I don't like it I just want it plain and it's got a little bit of a border just so we see it has a very raggy edge so it's kind of on the borderline of being usable but it's not really quite what I want I want something which is fully usable so this time I'm going to say create sine wave in Photoshop sounds like a good candidate doesn't it Photoshop and draw sine wave so we'll make a line like this there's a nice straight line rasterize it and select filter distort wave firstly we can see this got this great big gap in it so that's no good and also we can see that it's composed of dots so it's not a line like I want it we're just going to have to abandon this because plainly it doesn't give the result that I need sine wave in Illustrator okay so how do we make a sine wave in Illustrator and we'll make a line so we can start like that go across like that so effect distort zigzag and I know what you have to do is it's already on the corner let's just preview it so there is definitely a zigzag what did it try and go away if that would be perfect wouldn't it so what I'm supposed to do is smooth it like that what I'm going to say is that it's very successful it's fairly successful it looks passingly like a sine wave but to my eye it doesn't look quite like a sine wave it's something about this transition here from crossing the zero point and just coming up to the peak there's just something wrong in the shape of that transition so I'm going to abandon that again so illustrator can't do it so back to Google so I'm going to try something a bit more ambitious I'm going to make sine wave in after-effects after face is such a powerful software surely you can make a sine wave this one is looking a bit arty for my requirements so I'm going to look at this one which looks a bit more sine wavy so I'm just going to play from here and let's put it in full-screen and the reason I've got the sound turned off is because there's no commentary and there's just some really horrible music in the background so it looks plausible where it's got to at this stage looks plausible and that would be something I would be able to go into After Effects and copy the stage that he's done to get to this point that wouldn't be difficult let's just play now we have it so what we've got here is you start seeing this dot Enis again and what we can see is it's gone dotty and I did try this and the output was dotty so clearly it does look like a sine wave up here it says wave type sine so I think we can trust it that it is a genuine sine wave but I don't want a dotty sine wave if we want to continue a sine wave so we're going to have to drop like on that as well so let's go back to Google try another software Apple motion these two guys they've got some good videos so what they're doing here is they they're using a particle emitter and it emits this particle then they're using you can see just here the wave shape is sign so I'm presuming that the software calculates the sine function accurately because why would it not so they're getting this particle emitter to emit particles in the shape of a sine wave but once again it's not continuous it's dot E or it's bobbly and I'm thinking that maybe I could make it continuous so let's just play a little bit of the video and see how it goes this is the point where I'm starting to think this could be serious and it could with a simpler elementary particle or whatever you supposed to call it then it could create a sine wave but also I'm thinking at the same time it could be a lot of work and then I can't actually get to the point that I want to get to it doesn't seem like the best way to draw a sine wave it's fascinating but not the best what do we do now so the answer is surely there's an online graphing thingi software what City thing where I can put in a function and it will give me a sine wave well look at this geogebra dot-org let's just look at graphing calculator my instinct is telling me that's probably the most advantageous so we've got a sheet of graph paper here virtual graph paper and here we can just put a function in I'm going to put in sine X and look at that we've got the sine wave already it's a bit small it's a bit small so I'm going to make it bigger and using the maths that I remember from school a long long time ago I can make it three times the size and that to me is looking like a good proportion but it's got the background in look here here's some tools show axes No show the grid no grid look at that we've got a perfect sine wave and we've got a white background I have to say that I didn't find a way of creating a transparent background so it's not quite what I wanted but it's good enough and it will do what about varying the frequency of the sine wave so we can see here it is looking nice but what if I wanted a higher frequency I can go in here and just multiply the X so that's a higher frequency and I can go as high as I like and if I want to lower frequency then I have to put in my dividing line and divide it by / - there we go there's our sine wave again so the next thing we need to try and do is export it so we've got this hamburger menu up here we can see you can see save export but I won't choose download as so I can download it as a PNG or SVG I would think that one of those is going to be the best option so let's do the PNG and at the same time I'll download it as the SVG so what's happened here is that I've got the PNG here but as you can see it has a white background it doesn't have a transparent background as I'd hoped for but this is better than the other results I was looking at and it's a good sign wave it's a perfect sine wave it's calculated and if i zoom in on it I can see that I've got a pretty good resolution so that's as good a resolution as I'm going to need for any practical purpose so it's just got that one little flaw no transparent background what about the SD SVG well it's rendered it with the white background unfortunately so that's a bit awkward - so they're both the same in effect so ones as good as the other the SVG seems to have a better resolution I think it's a larger file size but we'll just skip over that for the moment so the thought does occur to me what about opening yes VG file in Illustrator because illustrator should be able to handle it and give me the transparent background that I want so unfortunately that has turned out no better it's just opened the whole thing with a white background it's made it a group so I've learned group it there just doesn't seem to be a thing I can grab hold of and delete the background so maybe I'm missing something there but I'm not getting the transparent background so I'm going to abandon that so no transparent background so we're back in Photoshop again and what I'm going to do is I'm really invert this invert to get a black background and that is very good for my require so I'm going to put that into Final Cut Pro 10 so now I'm going to animate it in Final Cut Pro night this image here is just something I was working on previously so now we can bring this down at the timeline and I've got my sine wave it's not animating because I haven't done anything with it yet so how I'm going to animate it is just to have it appear and disappear and I'm going to do this in a very simple way I go to the generators and I go to solids and I take just that custom black so it starts off at black and black is all I want so putting it on top there blanks out the sine wave completely so the sound wave is still there so what I'm gonna do here is I'm going to animate the black solid show video animation and it's going to be transform and then I'll go back to the beginning and start off with I'm going to make a keyframe which is an option K so that is now keyframed and I'm going to have it come in over the course of a second so that is just there and on the next frame is where it's going to be fully revealed I could make another keyframe but it will make another keyframe if I just put in a type in a value here so 1920 that's the default width of the image so at that point we've got the full width of the image and so now we've got the animation oh my goodness that was easy wasn't it so let's animate its out again so I'll go to two seconds the next frame after two seconds and I'll do option K to get another keyframe with the same values now I'd go on for another second and at that point I'll go back to zero which is the normal position so that's it it's gone all the way back yet so if I play the animation sine wave comes in sine wave goes out it's as simple as that isn't it I mean what I can say is that trying to work out how to do all of this for the first time is a bit tricky so I don't need to see that anymore hide video animation I know if I want I can make that a compound clip so it's all one thing and then just to make it more fun let's have it go in and out
a few times
and let me play it
okay I'm going to leave it there I've created a perfect sine wave and animated it which was the object of the exercise and in the process we found that it's not easy to do it in Photoshop it's not easy to do it in Illustrator it's not easy to do it in After Effects and it's not easy to do it in Apple motion but by using the power of a graphing calculator we can get a perfect sine wave then we can tweak it a little bit in Photoshop and then animate it quite simply in Final Cut Pro 10 or any other video editing software thank you for watching
you
Comments on this video
You can comment on this video at YouTube
You can comment on this video at YouTube
Sriya Mukkavilli: You can remove the white background by using the 'wand tool'. Simply press 'w' and select the white area and delete. After that, you should be able to get a transparent image with just the sine wave.
Audio Masterclass replies to Sriya Mukkavilli: This would be a nice simple solution if it worked. Perhaps you have a different version of Photoshop to me but I couldn't get a clean edge just by deleting the background. DM
Drum Ape: This really helps me, thank you!
Terry Maple: I want a sine wave that wiggles in place. Can that be done with your method?
Terry Maple replies to Terry Maple: @Sriya Mukkavilli cool thanks I’ll give this a go!
Sriya Mukkavilli replies to Terry Maple: it might be a late reply but here we go. If you have the png version then you can get it into any video editing software like davinci resolve, premeire pro or even phone apps. zoom in a little and automate the movement so that it moves one side to the other (for e.g. left to right) . if you want this to be a longer loop then you could automate it such that the first frame and the last frame are the same image (for e.g the second wave cycle begins when the firt one ends) and then simply loop it.
Hope this helps
Audio Masterclass replies to Terry Maple: I don't think my entire brain was engaged when I first replied. It should be straightforward to animate the width for frequency and the height for amplitude. The issue however would be that the width of the line will change as the image is stretched or squashed. It would be something to try out and see how well it works. DM
Terry Maple replies to Terry Maple: @Audio Masterclass ah, thanks. Yes I just want the former: for it to appear to be moving sideways
Audio Masterclass replies to Terry Maple: It depends what you want - if you want the sine wave to move sideways then yes that's easy to animate. If you want it to change in amplitude or frequency then no, that would be difficult using this method. DM
Aristotle Onassis: Could you show how software oscillators capture audio signals and how errors are caused in showing the true signal due to the filters involved?
Aristotle Onassis replies to Aristotle Onassis: @Audio Masterclass yes I mean the visual errors caused by the sinc filter when designing software oscillators. It shows a distorted which isn’t really there
Audio Masterclass replies to Aristotle Onassis: I can consider this topic for the future. In general though, digital sine waves are good enough for any practical purpose, and may be lower in distortion than some analog oscillators. Digital square waves however are visibly inferior to a good analog square wave, but you would find it hard to hear the difference. DM