/* * * Copyright © 2005, University of Washington, * Department of Computer Science and Engineering. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither name of the University of Washington, Department of Computer * Science and Engineering nor the names of its contributors may be used to * endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include "cse466_progspace.h" /* Startle Song - * Note: first element is number of notes/rests in array * second element assures the proper timbres are used */ uint16_t distress_call[31] = { 30,0xFc00,0xF500,0xEa00,0xDf10,0xF800,0xEd00,0xE600,0xDb10,0xF400, 0xE900,0xDe00,0xD710,0xEc00,0xE500,0xDa00,0xCf10,0xE800,0xDd00,0xD600, 0xCb10,0xE400,0xD900,0xCe00,0xC710,0xDc00,0xD500,0xCa00,0xBf51,0x3078, 0x3078}; // sing startle song (distress song) - you can use this method to play the // startle song. remember to reset the tempo and volume registers before // you play another song void sing_distress() { uint16_t z, ph; send_fm(0x32,0); // stop FM generator // restore these just before singing another song // set tempo data $31 19 for distress send_fm(0x31,19); // tempo for distress call // set volumes $35, $36 both values full loudness send_fm(0x35,0x1f); // up full send_fm(0x36,0x1f); // always 0x15 except for distress ph = distress_call[0]; for(z=1;z<=ph;++z) { send_fm(0,distress_call[z]); } // set up interrupt send_fm(0x34,0x0021); // start FM $32 = 1 send_fm(0x32,1); } /* Regular 16 - * index 0 = number of note/rest events in each array */ cse466_prog_uint songs[16][99] = { /* song 0: bbwa */ { 35, 0x3040,0xc813,0xbc09,0xb408,0x3020,0xd408,0xcc09,0xc823,0xc408,0xbc08, 0xac08,0xc408,0x3010,0xd408,0xdc08,0xd808,0xdc08,0xd808,0xd409,0xcc13, 0xbc08,0xb408,0xa808,0x3008,0xb808,0x3008,0xe409,0xdc08,0xe423,0xe808, 0xe408,0xe808,0xe408,0xe808,0xe408,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, /* song 1: bpwa */ { 30, 0x3040,0xfc08,0x3008,0xfc08,0x3028,0xfc09,0x3030,0xfc08,0xfc08,0xfc09, 0x3028,0xfc08,0xfc08,0xf808,0xfc08,0x3020,0xfc08,0xfc08,0xfc08,0xf808, 0xfc08,0x3020,0xfc08,0xfc09,0x3028,0xfc08,0xfc08,0xf808,0x3010,0xfc08, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, /* song 2: brcr */ { 51, 0x3038,0xf408,0xec08,0x3010,0xf408,0xec08,0xf408,0xec09,0x3038,0xe409, 0xdc08,0xe409,0x3010,0xe408,0xe808,0xe408,0xd808,0xd408,0xe408,0x3018, 0xe413,0x3018,0xe408,0x3010,0xe408,0x3008,0xf408,0xe408,0xec09,0xe808, 0x3008,0xec08,0x3008,0xec08,0x3008,0xe408,0xec08,0x3018,0xcc09,0x3010, 0xcc08,0x3008,0xd408,0x3010,0xcc08,0x3010,0xd408,0x3028,0xdc08,0x3010, 0xdc08,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, /* song 3: cardinal */ { 74, 0x3040,0x8408,0x3018,0x8c08,0x3010,0x9808,0x9c08,0x3008,0x9c08,0xa408, 0xa808,0xac08,0xb808,0xbc08,0xc408,0xbc08,0xc408,0xac08,0x3040,0x7409, 0x7809,0x7c08,0x8408,0x8808,0x3010,0x8c08,0x9408,0x3008,0x9808,0x9c08, 0xa408,0xa808,0xac08,0xb408,0xbc08,0xc408,0xcc08,0x3018,0xac08,0x8c08, 0x8808,0x8408,0x7c08,0x7809,0x6c09,0x3030,0xa808,0xac08,0x3008,0x8808, 0x8408,0x7c08,0x7809,0x6c08,0x7408,0x6c08,0x3030,0xa808,0xac08,0x8c08, 0x3008,0x8808,0x8408,0x3008,0x7c08,0x7808,0x6c08,0x3038,0xac08,0x3010, 0x8808,0x8408,0x3008,0x7808,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, /* song 4: indigobu */ { 98, 0x3048,0xcc08,0xc808,0x3010,0xc808,0xcc08,0xd409,0x3018,0xe808,0xdc08, 0xe808,0xc808,0xa408,0xa808,0x3008,0xc808,0xc408,0xb808,0xb408,0xac08, 0xb408,0x3010,0xe408,0xdc08,0xe408,0xc408,0x9c08,0xa408,0x3008,0xc808, 0xc408,0xbc08,0xb409,0x3018,0xe408,0xe808,0xf808,0xf408,0xe808,0xe408, 0xd808,0x3010,0x9c08,0xa408,0xa808,0xac08,0xc408,0xcc08,0xc408,0x3010, 0xdc08,0xe408,0xe808,0x3008,0xf408,0xe808,0xe408,0xdc08,0xd808,0xd408, 0x3008,0x9c08,0xa408,0xa808,0xbc08,0xc808,0x3018,0xe808,0x3008,0xe808, 0xd808,0xd408,0xcc08,0xc808,0xbc08,0xb408,0xa808,0x9c08,0x3010,0xac08, 0xb408,0xb808,0xbc08,0x3010,0xd808,0xe408,0xe808,0xdc08,0xd808,0xd408, 0xcc08,0xc808,0xc408,0xbc08,0xb408,0xa408,0x3010,0xac08 }, /* song 5: junco */ { 98, 0x3030,0xd808,0x3008,0xc408,0x3010,0xd808,0xc408,0x3010,0xd808,0xc808, 0xbc08,0x3008,0xd808,0xc808,0xbc08,0x3008,0xd408,0xd808,0xcc08,0xc408, 0x3008,0xd408,0xd808,0xc408,0xcc08,0x3008,0xd408,0xd808,0xc408,0xbc08, 0x3008,0xd808,0xc808,0xbc08,0x3008,0xd408,0xd808,0xcc08,0xc408,0x3008, 0xd408,0xd808,0xc408,0xc808,0x3008,0xd408,0xd808,0xc808,0xbc08,0x3008, 0xd408,0xd808,0xc408,0xc808,0x3008,0xcc08,0xd808,0xc408,0xbc08,0x3008, 0xd408,0xd808,0xcc08,0xc408,0x3008,0xcc08,0xd808,0xc408,0x3010,0xd408, 0xd808,0xc808,0xc408,0x3008,0xd408,0xd808,0xc408,0x3010,0xd808,0xc808, 0xbc08,0x3008,0xd408,0xd808,0xc408,0xc808,0x3008,0xd808,0xc808,0xc408, 0x3008,0xcc08,0xd808,0xc408,0x3010,0xd408,0xd808,0xcc08 }, /* song 6: mowa */ { 62, 0x3038,0xac08,0x3008,0xc809,0xcc08,0x3018,0xc808,0xa408,0xb408,0xa408, 0xb408,0xa808,0xb408,0xc408,0xd408,0xc408,0xc808,0xc408,0xcc08,0x3008, 0xc808,0xd408,0xcc08,0xa808,0xcc08,0xa808,0xac08,0xa808,0xb408,0xc808, 0xc408,0xc808,0xc408,0xc808,0xc408,0xdc08,0xc808,0xa808,0xb408,0xa808, 0xb408,0xa808,0xb808,0xb408,0xc808,0xc409,0xc808,0x3010,0xc408,0xa808, 0xb408,0xa808,0xb408,0xa808,0xac08,0xb408,0xc408,0xbc08,0xc408,0xd408, 0xcc08,0xc408,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, /* song 7: oriole */ { 34, 0x3018,0x9808,0x9408,0x8c08,0x9408,0x8813,0x3040,0x9808,0x9409,0x8c08, 0x3030,0x9408,0x8808,0x3008,0x9409,0x3040,0xb808,0xac08,0x9808,0x3018, 0x8c08,0x9408,0x8c08,0x9409,0x8813,0x3040,0x9808,0x9413,0x3018,0x9408, 0x3008,0x9808,0x9408,0x8c09,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, /* song 8: osprey */ { 31, 0x3030,0x7c08,0x3028,0x8808,0x8408,0x7c08,0x3020,0x8c08,0x8808,0x8408, 0x3028,0x8c08,0x8808,0x8408,0x3028,0x9408,0x8c08,0x8808,0x8408,0x3020, 0x9408,0x8c08,0x8808,0x3028,0x9408,0x8c08,0x8808,0x3028,0x9408,0x8c08, 0x8808,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, /* song 9: oven */ { 94, 0x3040,0xbc08,0xb808,0x3030,0xbc08,0xb808,0x3030,0xbc08,0xb808,0x3030, 0xbc08,0xb808,0xb408,0xa408,0xa808,0x3010,0xb808,0xcc08,0x3008,0xcc08, 0x3018,0xd808,0xbc08,0xb808,0xb408,0xa408,0xa808,0x3018,0xc408,0xcc08, 0x3008,0xcc08,0x3010,0xe408,0x3008,0xbc08,0xb808,0xa808,0xa408,0xb408, 0x3010,0xe808,0xbc08,0xcc08,0x3010,0xe408,0xe808,0xc408,0xbc08,0xb808, 0xb408,0xa808,0xb408,0xb808,0x3010,0xbc08,0xc408,0xcc08,0x3010,0xe808, 0xd808,0xdc08,0xd808,0xbc08,0xb808,0xb408,0xb808,0xbc08,0xb808,0x3010, 0xec08,0xe408,0xbc08,0xcc08,0xc808,0x3008,0xd808,0xe408,0x3008,0xc408, 0xbc08,0xb809,0x3018,0xb808,0xc408,0xcc08,0x3010,0xe408,0x3008,0xd808, 0xbc08,0xb808,0xbc08,0xb808,0x0000,0x0000,0x0000,0x0000 }, /* song 10: songspar */ { 92, 0x3038,0xec09,0x3040,0xec09,0x3020,0xec09,0x3020,0xec09,0x3020,0xec09, 0x3020,0xd408,0xcc08,0xd413,0xcc08,0xd408,0x3008,0xd409,0xd808,0xd409, 0xd808,0xd408,0xd808,0xd408,0xcc08,0xd423,0xcc08,0xd408,0x3010,0xd809, 0xd408,0x3008,0xbc08,0xa809,0x3010,0x9808,0x3010,0xd809,0x3010,0xb808, 0x3008,0xa808,0xa408,0x3008,0x9808,0x9408,0x3010,0xd809,0x3010,0xb808, 0x3008,0xa809,0x3010,0x9808,0x3010,0xd809,0x3010,0xb808,0x3008,0xa809, 0x3020,0xd808,0x3010,0xd808,0xd408,0x3010,0xd808,0xd408,0x3010,0xd808, 0xd408,0x3010,0xd408,0x3010,0xd808,0xd408,0x3010,0xd408,0x3010,0xa409, 0xa808,0xa409,0xa808,0xa408,0xa808,0xa408,0xa808,0x3010,0xec09,0x3020, 0xa408,0x9c09,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, /* song 11: towhee */ { 60, 0x3038,0xec08,0xdc08,0xd408,0xcc08,0x3038,0xb808,0xbc08,0x3030,0xd408, 0xcc08,0xc408,0x3008,0xc808,0xd408,0xc808,0xb408,0x3008,0xd408,0xcc08, 0xc808,0x3010,0xd408,0xcc08,0xb808,0x3008,0xc408,0xcc08,0xc808,0xb808, 0x3008,0xd408,0xcc08,0xb808,0x3010,0xcc08,0x3070,0xb408,0xac08,0xb409, 0xb808,0x3040,0xec08,0xd808,0xcc08,0xc808,0x3028,0xb808,0xbc08,0xb808, 0xbc08,0xb808,0xb408,0xac08,0x3010,0xb808,0xbc08,0xb809,0xb408,0xac08, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, /* song 12: tuftedti */ { 63, 0x3020,0x9808,0x9408,0x9808,0x9408,0x8c08,0x8808,0x3008,0x8408,0x3018, 0x9813,0x9408,0x8c08,0x3010,0x8408,0x8808,0x3018,0x9813,0x9408,0x8808, 0x3010,0x8408,0x3018,0x9c08,0x9813,0x9408,0x8c08,0x8808,0x3010,0x8408, 0x3040,0x9809,0x9408,0x8c08,0x8808,0x3008,0x8408,0x3020,0x9808,0x9408, 0x9808,0x9409,0x8c08,0x8808,0x3010,0x8408,0x3018,0x9c08,0x9813,0x9408, 0x8c08,0x8808,0x3008,0x8408,0x8808,0x3018,0x9c08,0x9813,0x9408,0x8c08, 0x8808,0x3010,0x8808,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, /* song 13: veery */ { 78, 0x3040,0x9808,0x3018,0xac08,0x3008,0xb408,0xa808,0x3008,0xa808,0x3008, 0xb408,0xac08,0xa808,0x3008,0xa408,0xb408,0x3010,0xa408,0x3018,0xa808, 0x3040,0xc408,0x3008,0xcc08,0x3008,0xcc08,0x3008,0xc408,0xb808,0xac08, 0xa808,0x3008,0xa808,0xb408,0xb808,0x3010,0xb408,0xb808,0xc408,0xbc08, 0xc408,0xcc09,0xc408,0xbc08,0xc408,0xb808,0xac08,0xa808,0xb408,0x3018, 0x9c08,0xa808,0xb808,0xb408,0xac08,0xa408,0x9c08,0x9808,0x9408,0x3008, 0x9408,0x3018,0x9c08,0x3010,0xa808,0xb408,0xb808,0x3008,0xb808,0xb408, 0x3008,0xa808,0xa408,0x9c08,0x3010,0x8c08,0x3010,0x9408,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, /* song 14: whthsprw */ { 43, 0x3030,0xb808,0x3010,0xb409,0xb808,0xb408,0xb808,0xb408,0xb808,0xb408, 0x3018,0xb413,0xb808,0x3010,0xb413,0xb808,0x3028,0xac08,0xa808,0xac08, 0xb408,0xac08,0xb423,0xb808,0xb408,0xac08,0x3008,0xb409,0xb808,0xb423, 0xac08,0xb409,0xac08,0x3018,0xac23,0xa808,0xac08,0x3008,0xac09,0x3018, 0xac09,0xb408,0xac08,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, /* song 15: wiwa */ { 66, 0x3038,0xc408,0xb808,0x3018,0xcc08,0x3010,0xcc08,0x3008,0xcc08,0x3018, 0xd408,0xe808,0xcc08,0xbc08,0x3010,0xe808,0xd408,0xe808,0xcc08,0xc408, 0xac08,0x3010,0xd808,0xd408,0xe408,0xcc08,0xbc08,0x3010,0xd408,0xc408, 0xbc08,0x3010,0xe808,0xd408,0xe808,0xcc08,0xbc08,0x3010,0xdc08,0xd408, 0xe808,0xc408,0xbc08,0xb408,0x3010,0xb808,0xcc08,0xe808,0xcc08,0xb808, 0x3010,0xb408,0xc808,0xcc08,0xdc08,0xcc08,0x3010,0xb808,0xc408,0xdc08, 0xcc08,0xc408,0x3018,0xb408,0xc808,0xcc08,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }};