Showing posts with label music. Show all posts
Showing posts with label music. Show all posts

Wednesday, September 28, 2016

Using Music to Teach Programming

So, what does Paul Simon have to do with array processing?

Glad you asked.

You Can Call Me Al Video

As anyone that has tried to teach arrays can tell you they can be a bit dry. Sadly, the best way to really understand anything in programming is to practice. One of the best workarounds I have found is storing music in arrays. My AP kids never really got into the classic drunkards walk program, but make it a random set of notes on a kazoo and tuba and they were all over it. Music lets them play, which means more practice.

This is fairly simple to do. Each note is a number, or an object, depending on the language. I have done this in Scratch, Visual Basic and Java with the kids. Scratch music is built right in, in VB we use the Beep command, and in Java I use the JMusic tools.

And what, you might be asking, does this have anything to do with You can Call Me Al?

If you listen ahead to about 3:30, there is a bass solo. A Palindromic bass solo. The first part was recorded by Bakithi Kumalo, then played backwards for the second half

The lesson:

  • Play the video - ask them if they notice anything about the bass solo - you might need to play it a few times, and it helps if you have some band kids in the room.
  • Make sure everyone understands palindromes
  • Code a tune - store your notes in an array.
  • Create a new array that will store the original tune, then store it backwards.
  • So if your original tune was:  A B B D E the new array would store A B B D E E D B B A
  • Demo the songs to the class.



Bassists Abraham Laboriel from Mexico and Bakithi Kumalo from South Africa

Another extension here is to watch the video of U-Bassists Abraham Laboriel and Bakithi Kumalo jamming in 2012. What happens if a musician makes a mistake on stage?

I am planning on using this as a journal prompt this year. One of the hardest things for new programmers happens around mistakes. Sadly this is a by product of much of the rest of their education. They are trained to find the right answer.  In computer science we care most about the correct solution, and that is usually going to take several tries. Sometimes the mistake points the way to a better solution. My goal is to get them to embrace their mistakes.


  • Making Music with Java - by Andrew Brown
  • More info on jMusic you can download it here: http://explodingart.com/jmusic/GetjMusic.html
  • Bakithi Kumalo Video playing the solo - on a fretless bass! Starts at min 2:20. While you are at it look at his hat - so want one.
  • And if you are really in the mood for more bass:  U-Bassists Abraham Laboriel and Bakithi Kumalo jamming in 2012
Curious if anyone is using music in any other languages - if so, please share. 
Read More..

Tuesday, July 29, 2014

HOWTO Streaming music from Ubuntu 10 04 to Android smartphone

Streaming mp3 or ogg audio files from Ubuntu desktop or server to Android is very easy. It just requires several steps to make it work.



You can share your music to other computers or Android devices via intranet or internet no matter the musics are sharing from Desktop or Server.



(I) Prerequisite



(a) Hardware

(1) One computer or server which is installed Ubuntu Desktop or Server 10.04

(2) One Google Nexus One or any Android smartphone 1.5 or higher

(3) Internet connection equipments (if any), such as router



(b) Software

(1) Install DAAP Media Player from the Android Market on your Android smartphone



(II) Server Side



Step 1 :



Install the Firefly on your Desktop or Server.



sudo apt-get update

sudo apt-get upgrade

sudo apt-get install mt-daapd




Step 2 :



Follows the instructions below and then copy or upload the audio files to the below mentioned directory.



sudo mkdir /home/media

sudo mkdir /home/media/music




Step 2a :



After copied or uploaded the songs to the directory, execute the following commands.



sudo chmod -R 755 /home/media/music



*Whenever you copied or uploaded new songs to the directory, make sure you carry out Step 2a. Meanwhile, to conduct "Start Full Scan" at Firefly web page to read the new songs into the database/playlist.



Step 3 :



Open a browser (such as Firefox) and point to the address of the server that installed mt-daapd :



Desktop -

http://localhost:3689



or



Server -

http://server_ip:3689



e.g. http://192.168.1.100:3689



Login with the username "admin" and password "mt-daapd".



Go to "configuration" and click "show advanced config".



Go to "Transcoding" section. Add the media extension to "Never Transcode" at the bottom of the page and then save.



For example, .ogg, .mp3



Step 4 (Optional) :



Go to "Server" section. Change the password of "Admin password" or add "Music password" if you want to have to enter password before listening to the music.



Changes "Compress" to "Yes".



Then save it.



Step 5 :



Go to "Server status" and click "Start Full Scan" button and you will see the figure of "Songs" is updated. Make sure you have uploaded or copied the mp3 or ogg files to the directory that mentioned above.



(III) Client Side



If you installed mt-daapd on the desktop computer, open Rhythmbox (or Banshee) and you will see the Firefly at the "Share" section. You can play the music now. You can also play the music within the same network on other computers.



If you installed mt-daapd on the server computer, open Rhythmbox (or Banshee) on the any desktop computers within the same network and play the music as mentioned above.



For Android, make sure you have installed DAAP Media Player from the Market. Open the application, you will connect to the mt-daapd server if you are connected via wifi.



Press "Menu" and select "Preference" to enable "SD Card as Cache" and "Streaming music".



You can select any music to play and press "Menu" to choose from "Stop", "Repeat" and "Shuffle".



(IV) Router



You may required to forword the port 3689 on your router if you want to stream your music via internet.



Enjoy your music on the road!



Thats all! See you.
Read More..