I may upgrade this website to my new web technology called "Natural Language Mouse Interface". See the demonstration or its page on sourceforge.net

You can get CodeSimian here and at other websites including:

CodeSimian - write code to create unique musical instruments and AI

CodeSimian's other website is http://sourceforge.net/projects/codesimian. I have created a new software for a similar purpose: Audivolv, described below. Audivolv will have a CodeSimian plugin. Both are GNU GPL 2+ open-source license(s). --Ben Rayfield

Audivolv - where Instruments Play The Musicians

* AI synthesizes music, and learns to control Human's hand on mouse.
* Human moves mouse, and learns to control synthesized music.
* AI translates music problems to programming problems, organizing Humans unconsciously through internet to build AI.



Click here to start CodeSimian immediately in a Java-Applet (in this web browser window)

To download and use CodeSimian, click CodeSimian.jar then click Open -or- click Save, find the file CodeSimian.jar, then double-click it.

If 3 windows do not appear, install Java 1.5 and try again.

Part of the next version of CodeSimian will be Immutable Sparse Wave Trees, a small LGPL licensed Jar file including sample audio synthesizing code that uses a wave tree buffer.

Within our lifetimes, software will become alive. We can all be a part of that through freeware open-source softwares which by design are not pawns of the existing machine. You must be a cog in some machine, but which machines is your choice.


CodeSimian does many things, including audio, bayesian AI, and natural language, but those things are too much separated. Thats why I started the Audivolv project. Read below for an example of CodeSimian's intelligent responses after I input the USA constitution into it's chatbot window then talked to it...

	Me: What is the constitution?
	CodeSimian:  of three thirty jersey four years to what is the
	Me: What is freedom?
	CodeSimian:  the new states except what is freedom
	Me: Why did you answer include the new states?
	CodeSimian:  declaring what is did you answer include the six new
	Me: What are you declaring
	CodeSimian:  than t did appointments answer include the united new
	states except what are you declaring
	Me: except what
	CodeSimian:  except are you declaring what
	Me: i am not declaring but are you declaring?
	CodeSimian:  did temporary appointments except what this constitution
	but are you article i am not declaring
	Me: what is temporary about appointments
	CodeSimian:  t labour but are you justice same exports crimes shall i
	will am not declaring what may make is temporary about appointments
	Me: so now you are not declaring you need to make up your mind
	CodeSimian:  or of except did temporary whose about appointments are
	so now you not declaring what is the states need to make up your mind
	Me: what are you asking me
	CodeSimian:  fill make up need to t not declaring what are fourth year
	so now you asking me
	Me: fourth year is year year year year
	CodeSimian:  he fourth regulations forfeiture except what is year
	Me: what about forfeiture
	CodeSimian:  two or what every second sixth article and fourth year is
	temporary about forfeiture
	Me: do you know what these words mean or are you just parroting
	CodeSimian:  did make few these words mean or forfeiture except know
	what about appointments are i do you just parroting
	Me: which few words do you understand
	CodeSimian:  know what which he shall any few these words mean or are
	do you understand
	Me: yes i understand but do you
	CodeSimian:  our posterity affirmation i understand but except in
	which few words do you
	Me: why was the constitution written
	CodeSimian: i section do you understand but was the constitution
	Me: yes it was written but why
	CodeSimian:  had signed it felonies been committed this was the
	constitution written but why
	Me: who committed them
	CodeSimian: any of who committed them

Java Programming

Artificial Intelligence

Art and Music


This code finds and uses JDK to create a Java class that returns 7 + x*y + z. The 0 is replaced by a new command with 3 parameters. If any part of input code cant be converted to Java code, it becomes parameter:

javaOutSimple( 0 +(7 *(x y) z) )

To get the source-code, download CodeSimian.jar and rename it to sourceCode.zip

Free, Open-Source: any GNU GPL 2+ license (this is version 3, you may like 2 better).

Core Design: CodeSimian has 1 main Java class: CS, which most other classes descend from, including classes generated at runtime. Every CS is a list of other CS, and the list has a minimum and maximum size specific to each class type. Numbers are a list size 0. MP3s are a list size 1 - 3. The first thing in an MP3 is the filename or URL. The second thing is optional: the position (any number). The third thing is also optional: megabyte limit of decompressed data.

The purpose of CS is to set, get, insert, or delete any range in the list as any Java type. For example, get indexs 3 - 7 as a double[] array or String. The doubles would have the same values as the chars in the String. CodeSimian's windows are made of these objects recursively.

For example, this code opens a window with a button that starts a sound when you click the "start" button and the audio frequency changes when you move the slidebar, which starts at position 70%.

window(horizontal( slidebar#s(.7) button#start(sound(sine(*(s count))) )))

To get a list of commands, for example, start the Jar file like this or type something similar:

java -jar CodeSimian.jar show me a list of commands

Or try typing something like this:

java -jar CodeSimian.jar play a sound that uses the microphone

Click here to go to CodeSimian's previous website, which is much bigger than this one.

CodeSimian.jar creates more Jar files similar to itself. Just change some text and click Save. This code creates a modified Jar that says 'Hello' when it starts:

do( setInnerFile('cs/start.cs' 'ask(\'Hello\')') saveUpdatedSelf('C:\\file.jar') )

Talk to CodeSimian. The window that appears in the front has a chatbot at the top. It writes sentences by the letter instead of using sentence templates, so if you say "what are you" CodeSimian might respond "ha at are you". It usually tries to rephrase what you say to it, but can have simple conversations.

You should copy/paste the text of any website into CodeSimian and press enter, then have a conversation about that website.

There is also a chatbot that puts sentences together as words (instead of letters). It is smarter but does not understand typos. Click Intelligent_Chatbots then word_level_chatbot to talk to it. Dont be confused by the strange way of typing. You type into the top, click the button, and text appears in the bottom. Then you erase what you typed in the top, type something else, and click the button again...

CodeSimian also includes bayesian and neural networks and simple evolution, but those things are not well connected to the rest of the software. For example, the learnSelfDFromSelfListD(inputs...) command.

Click here to go to CodeSimian's previous website, which is much bigger than this one.

To play an MP3 backwards at double speed, use this code:

sound(mp3("C:\\music\\xx.mp3" *(-2 count)))

Or replace "C:\\music\\xx.mp3" with 1 of these recordings of CodeSimian...
"http://codesimian.com/fractal.mp3" "http://codesimian.com/b.mp3" "http://codesimian.com/c.mp3" "http://codesimian.com/d.mp3"
Draw a musical instrument in any paint program while you play it with the mouse. Or move the mouse over any picture. Click the "sound of your computers screen pixels around your mouse" button. The sound is literally the brightness of the screen pixels in a rectangle around your mouse, from left to right then top to bottom like you would read a book. If pixel brightness is height of a record surface, its like a record needle scraping over your pixels.

Paint programs become musical instruments.

Sound-card requirements: CodeSimian does not work with cheap sound-cards. You can play and create sounds with a medium card, but you need a good card to use your microphone or musical instrument plugged into the microphone hole.

Electric Guitar: I have an electric-guitar which I plug into my card. Its a normal guitar that can work with normal guitar equipment, not one of those USB guitars. Some parts of CodeSimian are designed specificly for electric-guitars, but you can also use those parts with a microphone. It just doesnt sound as good.

How to write an equation that generates sound?

The simplest codesimian code that plays a sound is: sound(sine(count))

It counts 0 1 2 3 4 5 6 7... in the sine, and between 6 and 7 (at 2*pi), it passes the place it started, but it rarely hits the same point on the sine circle. It calculates that 22050 times per second (numbers between -1 and 1), converts it to a format your sound-card understands, and you hear it. You can make equations the size of 1 paragraph of text and they will play ok on a medium sound card.

If those equations include the word microphone, they will give nonsense data if you dont have a good sound card.
Example codesimian code: sound(microphone) plays the microphone on the speakers with no changes.
Example codesimian code: sound(*(microphone 5)) plays the microphone at 5 times normal volume.
Codes/equations can get much more complex if you want them to.

This code plays a.mp3 at dynamic speed proportional to microphone input:

sound(mp3( "http://codesimian.com/a.mp3" +=(0 abs(microphone)) ))

This code plays the sound of your screen pixels around your mouse, as described above.
do( window(slidebar#speedslider(.7) 300 80) timer( thisComputersScreen#theScreen( pixels2dBrightnessFraction#pix -(mouseXPos .05) -(mouseYPos .05) .1 .1 ) .1#timeInterval 1800#howManyTimes ) sound(-( interpolate( pix *(count 165.4321 ^(speedslider 5)) ) .5 )) )

Click here to go to CodeSimian's previous website, which is much bigger than this one.
When you see the 3 windows, click the LOAD_AND_SAVE button and a window with some filenames opens. Click a filename to load it, then click either "compile" button and it does what the code() says. You can replace the filename at the top of the second window to search for files.

You will need to know how to copy and paste text. To "copy" text, select it with the mouse, hold the ctrl button, and push C. You dont see anything change, but if you "paste" after that, the text appears where you pasted. To "paste" text, hold the ctrl button and push V.

To save the changes you make to CodeSimian (as a new Jar file), click Self_Modifying_Jar_File then click save_new_unique_CodeSimian.jar. If you made Java changes, you will need to click "CodeSimian Java Compiles itself".

Click here to go to CodeSimian's previous website, which is much bigger than this one.