mathematics as a basis for music

or .. mathematics as a basis for art (part 2)
I’m a little late to the party.

I was researching natural number sequences to create number generators when I came across the OEIS (online encyclopedia of integer sequences). It has a whole bunch of sequences, and I had only created a few (fibonacci, padovan, perrin, lucas and feigenbaum). Not only that, it lets you listen to the sequences by deriving pitch and duration from the sequences via midi files.
It uses another site to generate the midi files, the Musical Algorithms site.

Man, that site is loaded. Besides number sequences, the site lets you input all kinds of algorithms and sequences including DNA sequences (ATGC), constants, powers etc.. and listen to them by tweaking pitch and duration (derived by scaling or mapping).

Oh well..
So, I’m gonna have to take a slightly different tack, probably filtering sequences based on criteria (such as some described in the book “This is your brain on music“), transforming them (like adding syncopations) and combining them..

Stay tuned…

Advertisements

Banning sites from your browsing experience

I use the internet for searching for things. That’s an understatement. I also use it for a variety of other things like hosting my web presence, or sending/receiving email for even voip. Well, I should probably say, I use the web for searching for things.

Searches (google) get you to a point where you can (hopefully) narrow down your choices to the information you’re trying to get to. Some sites are heavily spammed using ads (google again), some sites give you pointers or more keywords that you can search on. It’s worked for me for a while.

What gets me is the cyber-squatters who try to lure people into trying them to buy into a domain that’s meaninful to you. But even more than that, it’s the sites that actually pretend to be one thing and give you something else.

What I think is a good idea for an opensource project is to have a way to ban sites from your browsing experience, such that, whenever you click on a link, it prompts you about the site being “knowledge agnostic” or “irrelevant to your search” or something. The key concept here is “your browsing experience”, personalized to you. Obviously there’s huge potential for abuse and spamming, but I would hope it prevails over the drive for unscrupulous commercial gain. That’s a judgement call, but hey, wikipedia prevails ( so does google by the way).

Obviously it would require some kind of a plugin in your browser (or bookmarklets etc) and a set of servers that the plug-in would reference for a site. There are similarities to the adult-rating or pro-family checking sites but this would be more general. It would cater to your preferences, somewhat like del.icio.us , based on tags you prefer, tags you don’t prefer and on top of that an editorized heirarchy of tags.

hmm..
another bou.dal.icio.us

If you think about it, it’s the anti-thesis of del.icio.us where you bookmark sites you want. This one would let you bookmark sites that you would not want, with just a click, and you could put tags so others can benefit besides you.

the calling of maui

A strange thing happened while on my whirwind trip to the east coast last week. Our plane got delayed at the San Francisco airport. The airport bar was as good a choice as any to spend the couple of hours that evening. One of the interesting characters I met there was a real estate developer from Maui. We talked a bit, exchanged contact information and so it went.
Later that evening, it so happened that the guy next to me on the plane was also from Maui. That’s a bit of lucky co-incidence and I told the guy so. He proceeded to impart on me his observation that this was probably the calling of maui. It’s beckoning to you, you should go, he said.
After mulling over it a bit I figured, why not? If it’s really a calling, then I’ll probably meet another person from Maui during my trip and if that’s the case, I’ll definitely go to Maui. After all I’ve never been there and it would make for a nice vacation at least. I told him so.
Well, I didn’t really come across another person from Maui, even though I did get to meet quite a few intriguing people which I’ll leave for another time. So much for the calling of Maui.

It did get me thinking about the concept of “calling”. Lots of people use that or another similar term to explain the decisions they took during their lifetimes. I hear things like, you do not choose a career, the career chooses you and so on.

I’d like to take that a bit further to say, it’s not just careers or vacation spots that do the calling. It’s also other types of decisions. The calling in most cases is not some vacation spot beckoning out to you through telepathic waves or something like that. I would put it more as a decision based on accumulation of tidbits you’ve had about that particular choice over the course of your life. As you progress through life, the more tidbits about a choice you gather, the higher up the stack it goes in your visible-choices stack. At some point that choice becomes the most visible and you make that choice and call it a “calling”.

Decisions like that are not flip/flop decisions as one would have you believe.

With that thought, I’d still like to go to Maui. It’s become more visible on my list of places to go, so maybe I’ll go there this winter. How’s that for “Maui’s Call”.

social network experiment

Social networks are back and they’re increasingly popular (+1 for the internet). It’s not a new phenomena. They’ve been around since people have been socializing. There are good examples of people in the history books who’ve been amazing social networkers. Travellers like Marco Polo were a good example because of the ad-hoc networks of people he created and connected.

What makes it different now is the ability to bridge huge geographic distances using technology. The internet, cell-phones/sms are allowing people to share experiences and create social bonds where it was impossible before.
Places like myspace.com and hi5.com are all well and good, some neat things have happened because of them. What is truly amazing are things that have come out of communities formed from interest pooling. Look at Wikipedia, it now has more entries than the Encyclopaedia Brittanica. Look at the Gutenberg project which has over 18,000 freely downloadable electronic copies of books published. Take a look at flickr or frappr.
I’ve edited some articles in Wikipedia and am a member of some groups on flickr. I have contributed bits of code to some opensource projects. I have come to be a little aware of the power of social networks. I wanted to see if I could actually get the ball rolling on a network of my own creation. I will obviously have to nurture what I create and spend inordinate amounts of time maintaining it and making it useful to a larger group of people. After a while, the hope is that it will take a life of it’s own, sort of evolve with interested community members helping it’s growth and sustenance.

With that in mind, I created Planet Nepal Wiki. It caters to a small subset of humanity. The primary goal is to capture bits and pieces about nepal, cultural nuggets and the like, that is not normally captured in written form. The sort of thing that is passed down orally through generations which have a potential in this increasingly uniform global landscape to completely disappear. The secondary goal is to create a community of users and contributors who have a vested interest in capturing that information, out of interest, a sense of cultural obligation or whatever. It may transform to be something else, I don’t know. I can’t make that call. That is part of the characteristics of social experiments. The crowd makes the decision. I have some awareness of the implications of that. There is less control, there is no heirarchical decision making body, the goals of the project are very prone to change, even the contents. Basically, there is uncertainty.

But that’s the challenge. To experience a different mode of working.

We shall contribute, and wait and see.

viva à l’inconnu (pardon my french).

On to the Planet Nepal Wiki then.

the god particle

I recently watched a new documentary about the neutrino particle on NOVA titled the ghost particle. Apparently the neutrino has been misbehaving. Or so it seems to us. It doesn’t fit the standard model perfectly, it has mass and it has alibis. Scientists have now stopped trying to figure out how or why it doesn’t fit the standard model and starting to poke it to show more of its colors. There will come a time, after enough poking around and seeing the neutrino do it’s dance, when we will have a different model showing how the neutrino fits in. And it won’t be just because of the neutrino. The standard model doesn’t account for gravitational interaction either.

The argument is, we as humans are always trying to see where the buck stops, who’s in control, what’s the explanation for all this, and so it goes. Therefore, we come up with a theory for how things fit in. Various religions have their own theories. Science has it’s quest for the ultimate Grand Unified Theory. Philosophers have straddled both science and religion and who knows what else to come up their own grand philosophies. There’s even a favorite of mine, the chaos theory with ties into fractal geometry and duality.

Yes sir, we’d like to believe that there’s an end of the line. We sorta think there was a beginning of the line although we may argue amongst each other about what or where exactly that was.

I’m not a scientist, I haven’t been trained as one. I’m not much of a theologist either. I, like many of you out there, am a bit confused. Therefore, to swim through the confusion and keep my head above water, I have also come up with my own way of figuring things out. I am perfecting my own philosophy. And like everybody else with their theories, I am ready to argue for my theories any time. In fact, I’ll probably jump to an occasion to spout my theories to anyone who’s willing to listen, and for that matter, to those who aren’t.

Sadly, the jumping-to-occasion phenomenon, applies to all. To scientists and theologians alike. Imagine a hundred people with hundreds variations of some dozen core theories. Multiply that by 70 million. That’s how many we are. That’s how many variations we get and that’s how many possible arguments we have. Quite a few of us, most of us in fact, will let go of our theories or stop arguing about it in the face of a stronger and more opinionated few. Most of us even follow their lead. Some theories become so strong in their hold among the people, that they become memes that survive through generations of people and civilizations and arguments and wars and destruction. The major religions are memes. Even science is a meme. The idea that there is a provable, repeatable explanation of how we come to be and the belief in that idea.

My question, a strand of my own philosophy, is this: will we ever stop? will we continue formulating and propagating memes to an unseeable generation in the future. Or is there so much unpredictability that the quantification of that “so much” is itself unpredictable. Are things changing and reformulating so much that there is no one god particle? The god particle at any instant is liable to transform into something else entirely.

Situations and circumstances may change but the underlying diversity, unpredictability and un-oneness of things is the only meme that’s stable. Our human society will be chaotic. A seething mass of unpredictable societal behaviour. There will never be one religion, one way of government, one morality, one grand unified theory, one god, one god particle or one ring to rule them all.

That gives me a little bit of comfort. It allows me to believe that anything is possible and that everything is a hack. The whole freaking universe is one big hack. Hack away, believe in your hacks and smile. Have a little fun. That’s what we’ve been doing after all.

update: the large hadron collider is coming online soon in geneva.

update: the god particle has been found.

pspad editor vb script to help with ruby on rails

I’ve been dabbling with ruby on rails (and ruby). Since I’m on windows, I don’t get to play with the mega-amazing-killer-editor-for-macs-only. So, I’m using pspad. It’s free, it’s lightweight and it’s good at what it does.
VBScript is kinda crappy. But hey, pspad supports it, so … here’s a small script I wrote to help with starting/stopping/browsing the webrick server on rails. copy, paste, save and enjoy. 🙂

Update: the code is posted at the pspad forum as well.

update: There’s some vbscript code to implement code completion for ruby here. Maybe I should take that code, build on it, and combine with my rails helper vbscript code.

update: The e-editor for windows is out (in bet form) now. Works with text mate bundles and uses cygwin to accomplish some of it’s tasks. Awesome!

' rails.vbs
' very simple rails helper script for use with pspad
' pspad is a wonderfule programmer's editor for windows
' free like all good things in life
' see http://www.pspad.com/
'
' could probably do a lot more than what i'm doing
' in this script.
'
' lapax at yahoo dot com
'
' only tested with pspad 4.5.0 (2175) and windows XP
' requires windows scripting host to be installed
' which probably comes installed with XP
'
' set your defaults e.g. DefaultRailsDir, Browser, Rubyexe
' unless the executables are in your path, you probably want
' to set the full path to the executables
'
' put this file in your pspadScriptVBScript directory
' either restart pspad or from menu run Scripts->Recompile Scripts
' you should get a new submenu called Rails
' Set your Rails Directory from that menu
'
' all blank lines have a remark character ' in front
' because of the way my wordpad parses the blog text
'
option explicit
const module_name = "Rails"
const module_ver = "0.1"
Dim DefaultRailsDir, Browser, Rubyexe
DefaultRailsDir = "c:projectsrubyrails"
Browser = "firefox"
Rubyexe = "ruby.exe"
'
' no need changing anything under here unless you're customizing the script
Dim RailsDir
RailsDir = ""
'
sub Test
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
msgbox WshShell.CurrentDirectory
Set WshShell = Nothing
end sub
'
'
function CheckRailsDir(dirstring)
if dirstring = "" then
CheckRailsDir = false
exit function
end if
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
if not fso.FolderExists(dirstring) then
msgbox "Folder " + dirstring + " does not exist, aborting.", vbExclamation
CheckRailsDir = false
Exit Function
end if
if not fso.FileExists(dirstring + "" + "configenvironment.rb") then
msgbox "Folder " + dirstring + " is not a valid rails folder, aborting.", vbExclamation
CheckRailsDir = false
Exit Function
end if
CheckRailsDir = true
end function
'
'
sub SetRailsDir
Dim input, tempdir
input = ""
if RailsDir = "" then
tempdir = DefaultRailsDir
else
tempdir = RailsDir
end if
input = InputBox("Enter Rails Directory:",,tempdir)
if CheckRailsDir(input) then
RailsDir = input
msgbox "Set Rails directory to " & RailsDir, vbInformation
end if
end sub
'
'
sub RailsStop
if RailsDir = "" then
msgbox "Rails directory not set, aborting.", vbExclamation
Exit Sub
end if
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.AppActivate Rubyexe
WshShell.SendKeys "^c"
Set WshShell = Nothing
end sub
'
'
sub RailsStart
if RailsDir = "" then
msgbox "Rails directory not set, aborting.", vbExclamation
Exit Sub
end if
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run Rubyexe & " " & RailsDir & "scriptserver"
Set WshShell = Nothing
end sub
'
'
sub BrowseRails
if RailsDir = "" then
msgbox "Rails directory not set, aborting.", vbExclamation
Exit Sub
end if
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run Browser + " http://localhost:3000"
Set WshShell = Nothing
end sub
'
'
' name "Init" is required, its called automatically during initialization to create menu items
sub Init
addMenuItem "Set Rails Dir", "Rails", "SetRailsDir"
addMenuItem "Start Rails Server", "Rails", "RailsStart"
addMenuItem "Stop Rails Server","Rails", "RailsStop"
addMenuItem "Webbrowse rails","Rails", "BrowseRails"
addMenuItem "Test Function", "Rails", "Test"
end sub
'
'
' end of file