User:Rnewkirk7954/ENES-100/project 2

Music Team Page (Project 2)

Olivia's Project 2 Page

Connor's Project 2 Page

Week0 Preferences
I will continue this project from the last one. At the end of the last project, I had looked into the best ways to wire the BeatBearing board.

The washer pairs should be rotated 90 degrees from the position in this version's tutorial. This way, the wires going to each washer half can be connected straight from one washer to the next without having to wind around the ground wire; this will also make it look cleaner and will be easier to repair should any wires come loose.

This weekend, I did not do much other than think about/plan the board I was going to assemble. I plan on using the measurements my team had listed for the last project, unless the new arrangement of washers causes a problem.

Week1 Narrative


This week it was my job to design how all parts of the BeatBearing sequencer were going to fit together. In other words, design the final product's internal arrangement. I had to consider simplicity, space efficiency, ease of repair, and storage. As I worked, I kept in mind the demographic/level of tech savvy the possible customer would have.

I started out by finding the dimensions of the parts that I had. The board and the monitor (the same size) were yet to be determined. This would depend on the parts I needed to build the actual board and the availability of different sizes of monitors. However, these exact measurements were not needed for the conceptualization.

I started out by making a simple diagram of what parts would go where inside the case. I treated the board and monitor as one part, since there is no need for them to separate. The wires leading from the electronics base to the board and monitor are ideally one cable.

Next, I will work on the arrangement of the parts on the electronics base. These include the arduino, MIDI shield, FPGA, and switch.

Week2 Narrative
This week I will finalize the casing design and begin working on the electronics base. If/when I finish these tasks I will learn how to use a program called Processing to create a code for the monitor and lights.

Casing Design
The casing design needs to be redone because the wires will not terminate on the long side of the plexiglass, where the protective shell and ball bearing storage were originally placed. This shell needs to be moved to one of the short ends of the board, where the channels and wires end.

I built upon this idea and designed a section I will call the side compartment. This box is attached to the short side of the board and monitor and protects the junction between the board wires and the rest of the electronics. The controls such as speed, volume, and reset are also in the side compartment.

The side compartment is divided into two parts;


 * Bottom: This part is where the wires from the board terminate and join together into a single connector. None of this should be visible in the end.


 * Top: This part rests directly on top of the bottom part and is where the electronics will sit. The MIDI/Arduino is oriented so that the MIDI in/out ports are accessible for connecting to an external synthesizer. The FPGA will also be in this part but will only be exposed if the controls on it are needed. A connection from the FPGA to the monitor will be made through/near the connector that joins the bottom and top parts of the side compartment.

The bottom compartment (different from the original bottom compartment from last week) will only be used for storing unused ball bearings unless another need for it arises.

Next, I played around with the Processing program to familiarize myself with it. I opened the first example, called "Array", to explore. Find examples by navigating to File -> Examples.

Practice example: Array
I did not save any variations of this code, I only played with some of the values to find out what they changed.

The following shows changes I discovered:

Original SetupDraw
SetupDraw is what I plan to use to represent the strip of color that will move across the monitor underneath the board.

Below is a screenshot of what the code looks like. The horizontal line moves from the bottom to the top at a steady rate. When it reaches the top, it starts over again at the bottom.

Original CreateGraphics
This is what I plan to use to represent the flashing circles of color that will appear underneath washers that have ball bearings sitting on them. This code will need to be picked apart to find the exact string of code that governs the fading of the circles.

Below is what the original CreateGraphics code looks like. White circles appeared where the mouse pointer was and slowly faded into the background.

SetupDraw + CreateGraphics
This is where I began working on the compiled code. Below is shown the two codes pasted one right after the other, with no changes made.

This combined code did not work, which was expected. Instead of running, it returned the error "Duplicate method setup in type sketch_131027a". sketch_131027a is the name of the file this code is saved in.

Week3 Narrative
This week I will work on adjusting the combined sketches so that they will work at the same time. Since I am now more familiar with the sketches, I started by erasing the comments I didn't need, to clean up some of the clutter.

SetupDraw + CreateGraphics
Cleaned up, reduced comment version:

.
Because of the error "Duplicate method setup in type sketch_131027a", I deleted the void setup and void draw lines in the CreateGraphics code, leaving the first instances of those lines in the SetupDraw code:

Trying to run this returned the error:

.
Next, I tried combining the sections underneath void setup and void draw for both sketches: This did not return any errors; instead, when the sketch was run, the display window appeared like a working sketch would; however, the window showed nothing but blank white.

.
Next, I tried to resolve the blank white display issue. Since there were no identified errors, there was nothing to trace. I looked up the possibility of using layers, such as on a paint program, to have one sketch layered on top of the other and both of them could run at once on the same screen. Such a concept did exist. Here can be found a tutorial on how to implement layers into a java sketch.

However, this required downloading a third party library to run (found here). I downloaded the library which was outdated by over two years. The directions for installation were also outdated because the specified destination folder did not exist in my version of Processing. I could either abandon this idea or try to find an older version of Processing to try.

Week4 Narrative
This week i started over on the code to try something different that might produce some usable results. Using this tutorial, i was able to get started on a new combined code. The tutorial warned that most of the time, merging code results in two independent functions running simultaneously.

The tutorial had 8 steps to follow:
 * 1) Physically get the sketches into the same file.
 * 2) Resolve any duplicate function names by renaming the functions.
 * 3) Write new setup and loop functions.
 * 4) Remove any duplication of function calls.
 * 5) Resolve any duplicate global variable names.
 * 6) Resolve any dual use of hardware resources.
 * 7) Tidy up the code.
 * 8) Think what you actually want the merged code to do.

1) Physically get the sketches into the same file.
I started off by going back to the original, simple SetupDraw + CreateGraphics code i formed earlier. A diagram of what it consists of:

2) Resolve any duplicate function names by renaming the functions.
The tutorial says attempting to compile the code will result in a 6 line error message, with Blink and Fade being the names given to the two sketches in their example: However, in Processing, this message do not appear. It simply says: just like before. There is also another identical error for the draw function.

The tutorial suggests changing the names of the setup and draw functions of each sketch so they are more unique. This way, the compiler will be able to differentiate between the identical functions, apparently. I was not convinced this would work but i decided to see what would happen. Based on the suggestions, the functions in SetupDraw_CreateGraphics would become:

3) Write new setup and loop functions.
In SetupDraw + CreateGraphics, there is no loop function, so i used the draw function instead. According to the tutorial, the compiler expects to find the functions setup and draw but i have renamed them, so they need to be "redefined".

I added the following code from the tutorial (edited to match the functions in my sketch) to the beginning of my sketch: This ran successfully without errors. The first image is the sketch i just ran. The white circle follows the mouse, but leaves no fading circles in its trail. The moving line from SetupDraw is also not visible.