Ever wonder how the square-root button on your calculator works? Nope, it's not the Underpants Gnomes. In this screencast we will demonstrate Newton's method of making a series of guesses, each one getting us closer to our answer. we're gonna need an average function which will take x and y, add them together and divide that by 2. now our newton function will take a guess in addition to our number that we want the square root of. It will divide our number by the guess and average that with the previous guess. Let's try it on 81. Start with an initial guess of 1.0. We get 41.0. So we run it with that. And again, and again, until we start to converge on the answer. As we see, the square root of 81 is 9. So now we can write a function to do that all for us. We'll get the absolute value of a number, by taking its negation and seeing which one's bigger. To check the answer, we square it, or multiply it by itself. We can now write our square root function. It will take an initial guess and a number. Make an if statement that will use our absolute value function to test whether we are within 0.0001 of our answer. If so return that value, otherwise we recursively call our newton function on it. We can now call square root on the number 81 and we get 9.
MilkyTracker: The quest for the perfect music software
The last album I made was in 2013 on a MacBook using Logic Pro and Massive, a setup that cost a couple thousand dollars. Since I no longer have that machine and the software was proprietary, I no longer have access to all of that work. This has sparked a great interest in searching for a replacement digital audio suite, one that would provide a comparable workflow but also offer longevity, the ability to archive my work in a format that can be shared across platforms and improved upon. An artist should demand nothing less! What if a painter had to stop working on everything because they didn't want to use canvas from a certain company, and then none of their brushes or paints would work? That's what is actually happening in today's creative landscape, but with software. Whatever program I use must, above all else, use a standard file format for music encoding, which is usually MIDI but there are others. That way none of my work is dependent on any specific piece of ...
Comments
Post a Comment