In Search of Sudokus with Good Alignment Properties for Musical Composition!!

Final Class Project in ISE575c, Spring 2007

by Dolly Dhariwal

  • Introduction
  • Sudoku and Music Generation
  • Concept of Alignment
  • Program Description
  • Program Instructions
  • Link to the Project
  • References

  • Introduction

    This concept was proposed by Professor Tamar Diesendruck; visiting Associate Professor of Composition at USC; and the project was guided by Professor Elaine Chew; Associate Professor of Multimedia, Human Cognition and Music at USC. The whole idea of the project is to generate music using a sudoku grid and find out the alignments in the sudoku grid. This experiment will be used by Professor Tamar and Professor Elaine to find a pattern in the music generation by sudoku. I don't know much about music but when I hear these sudoku play. I find some sudoku play according to a pattern and generate a new idea. In some sudokus it seems the same pattern in repeating. Which makes me think that there is some kind of relation in these random numbers. Lets see what the reasearch results into.

    Sudoku and Music Generation

    Sudoku is a logic-based number placement puzzle. The objective of that grid is to fill 9*9 grid so that each column, each row and each of the nine 3*3 boxes contain the digits from 1 to 9. Now we use this sudoku grid to generate music. We assign each number a piece of music, which means we have 9 pieces of music each related to number 1 to 9. Now to Play the sudoku grid it means that we will take each row one by one and play music piece related to each number in that row continuously. Each sudoku will play for the same time as each row will play for the same time. The time span of the piece related to each number follows a simple arithmetic progression. for example, the piece for number 1 will play for 5 seconds, for number 2 will play for 6 seconds, for number 3 will play for 7 seconds and so on.

    Concept of Alignment

    Let us take the first 3 rows of the shown sudoku grid. If we sum up each row it will result in 45. As the sum of first n numbers is n(n+1)/2. So if we each number a color then we will see that 1st and the second row coincide on 25th beat and 33rd beat. So we will count them as 2 alignments. Now we see that 1st and 3rd row coincide at 18th and 25th beat. So far we see that there are 4 alignments. This way we check for each row how many alignments are there and sum them up.

    Program Description

    This program is written in PERL CGI scripts. It reuires IE explorer browser to play the sudokus. If one wishes to run it in firefox it will require different plugins to be installed to play midi files. It doesnot require any other environment or software to run.

    Algorithms

    The algorithm used is to find number of alignments in the sudoku grid. The steps of the algorithm are as follows:
    1. For each row. Assign row a number. Let it be K where K varies from 1 to 9
    2. For each row. Assign each row a number. Let it be J where J varies from 1 to 9
    3. For each column. Assign each column a number. Let it be I where I varies from 1 to 9
    4. If J<=K then J=K+1
    5. Calculate Sum as sum of the Kth row till ith column
    6. Calculate Sum1 as sum of the Jth row for each colum
    7. For each column of Jth row check If Sum=Sum1 then increment the alignment variable align by 1

    The other Algorithm is used to play the midi files for a specific time and accoridng to the number in the current sudoku grid.

    The GUI can be seen on the given link.    In Search of Sudokus with Good Alignment properties for Musical Composition

    I used Anvil Studio software to fragment the pieces of music. It is a wonderful software which can does the following things: This program allows you to:
    Record, play, compose, and edit standard multi-track MIDI music files,Record, play, and edit audio tracks using standard .WAV files, Compose rhythm tracks with your own sampled percussion sounds, Manage synthesizer Patch Libraries, Practice piano exercises. The software can be downloaded from the following linkDownload

    Program Instructions

    1. First it would be good to hear all the pieces of music related to each number for that select the number and click on "play number". If you wish to stop the music in between click on "Stop number".
    2. The number of alignments for the sudoku will be displayed in the text box near the "Alignment" button.
    3. To play the sudoku hit the "Play" button on top of the page.
    4. If you want to go to next sudoku or the previous one hit on "Next" and "Prev" buttuon respectively.

    References

    1. The concept as mentioned was given by Professor Tamar Diesendruck.
    2. The fragment of midi files selected for each number was taken from the following site Midi Files 3. The Beatles composition I used were: Magical Mystery Tour, Baby You're a Rich Man, All you Need is Love
    The Elvis Presley's compositions: Teddy Bear, Viva Las Vegas
    The Linkin Park's composition: Crawling, One Step Closer
    4. Some compositions I used were from the systems My Music folder which comes with the Windows XP OS like: Sonata-c,air,FugueGM


    Link to the Project

    Project Link




    Copyright (c) 2007 Dolly Dhariwal

    The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees