Monday, March 1, 2010

The soft side of firmware

Hey Guys!

Its me again, and today I am going to tell you how the firmware for our E-Oc will work! The design behind the E-Oc software for our prototype will be pretty straight forward guys, one of the biggest features people have shouted for is configurable fingering! Which I plan to support so lets talk about that now.

So, users will be able to configure their E-Oc to have diffrent button configurations play different notes. What happens when a user presses a button, is it causes two pins of our micro controller to go "hot" which means there is voltage flowing through them, this is called an "input"

We can get "input" states in code, normally as a 1, which means "on" or a 0 which means "off", so each time a button gets pressed we get that pins input state and save it to a matrix in its own little place.... Wait, you don't know what a matrix is... no.. im not neo.. I will explain.

A matrix is a group of numbers, for instance
[0,0,0,0]
[1,1,0,0]
[1,1,0,0]

Thats a visual representation, of a matrix. So on a 12 hole Oc we would have 12 places in our matrix. Ohh Its starting to come together now is it not?

So what happens is when a button is pressed it sets that buttons place in the matrix to a 1. So for instance if a user was playing a C then the matrix would look like this.

[1,1,1,1]
[1,1,1,1]
[1,1,0,0]

Which would mean that all the buttons besides the sub holes where held down. Lol, im kind of new to the Oc, so I am not sure if the sub holes are used in the tonic.. but yeah.

So what happens then is every millisecond (1000th of a second) we check the matrix to see what buttons are pressed and play the correct note for the buttons pressed.

So changing out what note is played will be as simple as changing what the matrix has to look like to play each note. Of course you guys will get a nice little windows program to point and click your way through it, but what will be happening behind the scenes is that we will just be placing a text file on the E-Oc that will look something like this...

[1,1,1,1]
[1,1,1,1] = C
[1,1,0,0]

[1,1,1,1]
[1,1,1,1] = D
[1,0,0,0]

Its a little different then that when we program but thats a good visual of it.

So thats the basics of how fingering and playing the note will work software side, pretty simple hey?

So now lets talk about blowing, the air sensor we picked out plugs into our micro controller just like our buttons, but when it senses air instead of giving a 0 or 1, it returns a decimal depending on the amount of air.

So .00 would be no air flow at all, and .99 would be like blowing as hard as you can in the E-Oc, so in code we just set the return of our air sensor to the volume of our stereo chip, every millisecound as well.

That sets our volume to our breath pressure, there of course will need to be a bit of calibration in testing, cause you don't want the volume to go up and down like crazy when your trying to blow constantly, but with a little bit of testing I am sure we can get something nice!


Theres other code, for other things like on and off switches, and system stuff, but thats really technical and I won't bore with the nerdyness haha!

So guys, I know that this was a long read, with lots of boring stuff, but I hope you enjoyed it!

Thanks again, and don't forget to comment!

Sunday, February 28, 2010

Full of hot air!

So guys,

I had told you that I was unsure of what sensor I wanted to use for breath, I figured a standard air pressure sensor would do it! However I got to talking to my buddies and one of them is really talented in this area, and he pointed me to the perfect thing.

Not only is it ninjaingly (is that a word?) cheaper then the other one, its way more powerful. This little baby can detect so many different changes in the air flow, that we can really do some very sweet stuff with it!

I know you guys are dieing to see what this bad boy looks like so!

Here yeah go:




Plus these bad boys are only about $20 bucks shipped to my door from Modern Device! Plus I only need one of them, cause I am not afraid that I am gonna fry one! WOOT!

So guys, I think everything is good to go now, I plan on starting to get some of the parts to my door next friday, and lets see what we can see hey?!

Friday, February 26, 2010

Parts List

Alright guys,

I don't know how many of you are keeping up with this, even less most likely cause I just started this project so many are waiting to see if it goes anywhere, before they D dedicate any attention to it.

So in hopes to appease everyone lets talk about whats going to go into the E-Oc!

1.) First off everyone I am sure wants to know what case design I went with well an all around great guy over on The Ocarina Network Bunjiro was kind kind hook me up with a Solist 12 Hole, Alto C, I don't have it in my hand yet, but I think this will house our eletronics very nicely. I just hope I get to play it for a while before I have to rip it apart.. haha I think this will be the one time I will not be checking the mail box every day waiting on a package. ;)

If you guys have been living under a rock and don't know what this very pretty oc looks like here a picture of it



2.) The next thing that I know everyone is on the edge of their seat about is about how to do fingering, specifically if I am going to use buttons, or light sensors, or like touch pads. Well for the sake of prototyping you can not beat the low cost, and just general ease of use that comes from your standard buttons. That to be said I am not with out concern to making the prototype easy to use, So I have selected two different types of buttons. The ones I want to go with are the nice clicky buttons that you see in arcade games. Heres a picture:



They are only .99 cents each fromSpark Fun so you can not beat that! I will be picking up 12 of these! I am a little bit worried that these are just going to be to big for the case, I mean granted sense we don't have to worry about silly things like physics in an E-Oc, I will not mind using my good old dremial to make room, but I also dont want this thing to look like it came straight out of a child's toy store compliments of CAPCON yeah know?

So I have selected a set of back ups, these are just standard momentary switches like the ones above with nothing fancy, most likely they are going to be to small for the holes so some sort of back plating under them to keep them in place for pushing. Heres a picture:



They are only .50 cents each so I will be ordering 12 of these too, I have a few on me already but if I am going to place an order might as well get them all just in case one goes bad (happens some times).

3.) Alright guys lets talk brains, what is going to make everything happen for us? Well thats easy, we are going to use a pretty popular micro controller solution called Arduino, these things are god sends for people trying to do hobby electronics, it is kind of "easy" mode for this stuff, because it has a lot of little tedious stuff that would need to be already done for you, so it makes it really easy to working on the meat of our project. Plus you can get them all different shapes and sizes so stuffing one in an our Oc case will not be hard. Heres a pic:



That one is all ready to go, and will be great for testing, it takes a standard 12 volt in, which for starters I will use just a standard wall plug, but later on we will add a battery, once the prototype is done and we start "slimming" stuff down.

Our development board costs more then our chip, the board runs $30 bucks, on spark fun. Once we get it working on a dev board, we can flash straight to chips, and the chips are only about $8 bucks each.

Ok, basically this is the thing the buttons plug into, the thing that the E-Oc code will run on, and is just generally the brain/computer that will drive our E-Oc.

4.) The next thing we need to look at is what is going to drive our sounds, there are a shit ton of options here, and prices can get pretty steep depend on what features you are looking for, well for our case we just want something that has volume control both digital and analog (digital means that you can control volume through programming and analog means it takes physical force to change volume, aka a wheel)

I will be picking up a wave shield for our arduino, basically what this is, is a solution that "plugs" into our arduino board above, and provides everything that we need to make our Oc sounds, the great thing is that it holds our sounds on an SD card! Which means that for testing we can try a verity of different OC recordings to get the best sound possible. It also means switching sounds, for chambers, tuning, or pitches, is as simple as just replacing the sound effects.

These bad boys are only $22 on Adafruit

Heres a pic of it plugged into the arduino:



Later on, we will be using a MIDI stereo chip for things like sound channels and our sound effects will be synthed via this chip, which means that we wont have to do any recordings, and pitch changes will be a breeze. The hard part is using a MIDI chip requires a rather large amount of code, and TONS of testing just to get things working right. So for now we will go with the above wave chip.

5.) Last but not least, we need a way to sense if the user is blowing, to well make noise, basically what happens is when this item senses pressure from the air it sends a signal to our micro controller, the stronger the pressure the more signal it sends (It does this via sending an amount of voltage to the micro controller, its a very small small amount, but its enough) So our micro controller reads the amount of pressure and then we set the volume on our WAVE chip, digitally based on the amount of voltage that the senser sends to the micr contorller. Sounds simple right!?!? One thing I am worried about is finding a unit that can easly go in our cases mouth piece, and most likely something that needs to be decently water proof. I have looked at a couple and have not made up my mind yet, but here is a picture of the one I am thinking about.




These things are like $25 bucks from Spark Fun

So, I really don't want to short a few of these out from spit, but I got to order two just in case, I hate having a project put on hold just because a part goes bad.

So, thats really about all we need to get started guys, anything else I most likely already have, and will just be small stuff that I have over looked, to make something work well.


So lets see cost to prototype:

1.) 24 buttons in two styles - $30 shipped
2.) Arduino Dev Board - $40 shipped
3.) Arudino Wave Shield - $30 shipped
4.) Ocarina Casing - FREE (Again, thank you Bunjiro)
5.) 2x Air Pressure Sensor - $50 Shipped

Total = +/- $150 to get everything shipped. Not to bad but not really in my budget. I have a copy of the arduino board, but I use it so often for various things, and with this type of thing, its going to be pretty attached to the Oc so, I will need to get me a new one.


So, as much as I hate asking, if anyone wants to do donate to the project, pm me, and I will give you guys my address, feel free to order any of the above parts and get them shipped to me. Though, please let me know before you order so that we can work on getting all of the parts needed, and not duplicates.


Well guys thats about it for this one, I have out lined the parts I have choicen as well as the reasons why, I hope everyone is as interested in reading this as much as I am on writing it!

Stay Tuned guys, the next one I do will be

Software Design

Here I will detail, the designs for the software that will drive our E-Oc and basically how everything will work software side.

Ideas!!!!

So, me and a buddy of mine were talking about this idea, and just basically bouncing ideas off each other, this is often called brainstorming in a development process but you guys most likely already know that.

Two ideas came from it and I feel that both of these ideas are freaking awesome, and would not add much to cost or extra coding work.

1.) Stereo slider of some sort that lets the user put more or less volume to the left and right channel while they are playing, basically its a spring wheel that when you slide one way it makes the left channel louder and lower on the right channel, and when it lets go it resets to both channels equal, and the same happens for the right respectively. So what this does is gives the artist the ability to make it sound like birds are all over the forest and various other things while play

2.) The second thing that we thought about, is using tilt sensors (very cheap and easy to use, they are in ipods and other things) to be able to bend the notes via tilting the E-Oc left and right (or up and down), it would be pretty freaking kewl, I think at least, and plus might make it easier to add "emotion" to your songs in a way that you could do just via swaying to a sad song.

Tell me what you guys think? Is this something worth me doing? Either feature wouldn't take much work to add, and I think would really set the E-Oc above a normal OC.

Also stay tuned later today for my post on parts lists and some design stuff!

Feel free to leave comments guys and thanks alot for reading!

Thursday, February 25, 2010

Mission Statement for the E-Oc

Alright guys, My first post is going to be a littler briefer then what I had wanted because I have a hot date tonight that I just found out about!

So I am going to do a quick mission statement and tell you what I plan to do and what I want to bring to the Oc with my eletricness (if thats a word haha!)

First and foremost:
Everything that I do from now until the end of this project will be open source, both hardware and software, and completely free for anyone to use for any non-commercial purpose. Distributors that are interested in selling this in their shop, I will be more then willing to neogiate something with you guys, but I believe that certain things in life should be freely shared, and music and knowledge are two of them.


Feature Set for prototype:

1.) Standard 12 hole Oc fingering with notes.
2.) Breath controls volume of out put sound.
3.) Amp plug for headphones, or speakers
4.) Music is played via sampled notes from a normal Oc

So basically it will do everything that a 12 hole Oc will do minus super advanced stuff like half hole covering and the like.

Each hole will be represented by a button, I know that a lot of people dont like buttons but we will worry about input after software.

When the software gets mastered with the feature sets of the community, we will work more on hardware and things like light sensors for buttons, or touch pads, so that we can do kewl stuff like bending a note by covering half the hole.

After the first prototype of software, I will move into using a MIDI chip and synthing the sounds, but for now that is a lot of work and much more expensive.