Discussion specific to projects ideas and support.
Post Reply
Posts: 20
Joined: 06 Oct 2010, 19:08


Post by rbnnxt » 17 May 2014, 16:24

I have recently completed a project to compose tunes using EV3. I have produced project files for both the Retail 31313 set and for a combination of the Education Core and Expansion sets 45544 and 45560. The project uses two motors as angular sensors to control the pitch and duration of notes which are then recorded in memory by pushing a button. Rests are catered for by playing a dummy note at a high pitch for the desired duration which doesn't sound. The model covers three octaves with semitone resolution and durations from 1 (designated semi_quaver) to 16 (designated breve). There is an option to specify one of four tempo for playing back the completed tune. The program also caters for saving tunes in one of 10 slots as a data file on the brick. These can subsequently be uploaded to a PC and stored as libraries. Currently I have three libraries of ten tunes each. These range from songs like Doh Re Mi from the Sound of Music, The Beatles Eleanor Rigby and When I'm 64 through Sousa's The Liberty Bell, Rossini's William Tell Overture to several Bach pieces. The longest is a rendition of the final movement of the Second Brandenberg Concerto, which lasts over 3 minutes. Complete details and articles about the project including file downloads are on my blog legoev3rbn.wordpress.com There are also videos on youtube in my channel rbn1tube. https://www.youtube.com/user/rbn1tube
The project is fairly straightforward hardware wise. It uses the brick screen and brick buttons extensively and on the retail set 1 push sensor, the IR sensor and the colour sensor, and on the education version two push buttons and the Utrasonic Sensor, with minor modifications to the program to accommodate the changes. The program is fairly complex. It starts with an initialisation myblock and then runs four infinite loops in parallel. One deals with generating the notes from the rotational position of the two motors, one with recording the notes in memory, one with handling the menu choices such as play, load and save a file, choose tempo, clear the tune from memory, delete or replay the last recorded note, and the last give a nudge feature to the note pitch motor to enable accurate selection of the pitch. Sometimes it is difficult to precisely position the arm, and so you set it just below the desired pitch and nudge the motor to the correct position. There are 25 MyBlocks and three programs. The main one called 002 and two utilities to help with the data files.

I hope you enjoy it.

Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands


Post by mightor » 03 Nov 2014, 06:08

A little late to the party, but thank you for sharing!

= Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests