Created
July 12, 2011 03:36
-
-
Save anonymous/1077345 to your computer and use it in GitHub Desktop.
music tracker for BL bleeps and bloops.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| datablock AudioProfile(MusicLowC) | |
| { | |
| filename = "base/data/sound/notes/Synth 4/Synth4_00.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| datablock AudioProfile(MusicDb) | |
| { | |
| filename = "base/data/sound/notes/Synth 4/Synth4_01.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| datablock AudioProfile(MusicD) | |
| { | |
| filename = "base/data/sound/notes/Synth 4/Synth4_02.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| datablock AudioProfile(MusicEb) | |
| { | |
| filename = "base/data/sound/notes/Synth 4/Synth4_03.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| datablock AudioProfile(MusicE) | |
| { | |
| filename = "base/data/sound/notes/Synth 4/Synth4_04.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| datablock AudioProfile(MusicF) | |
| { | |
| filename = "base/data/sound/notes/Synth 4/Synth4_05.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| datablock AudioProfile(MusicGb) | |
| { | |
| filename = "base/data/sound/notes/Synth 4/Synth4_06.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| datablock AudioProfile(MusicG) | |
| { | |
| filename = "base/data/sound/notes/Synth 4/Synth4_07.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| datablock AudioProfile(MusicAb) | |
| { | |
| filename = "base/data/sound/notes/Synth 4/Synth4_08.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| datablock AudioProfile(MusicA) | |
| { | |
| filename = "base/data/sound/notes/Synth 4/Synth4_09.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| datablock AudioProfile(MusicBb) | |
| { | |
| filename = "base/data/sound/notes/Synth 4/Synth4_10.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| datablock AudioProfile(MusicB) | |
| { | |
| filename = "base/data/sound/notes/Synth 4/Synth4_11.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| datablock AudioProfile(MusicHighC) | |
| { | |
| filename = "Add-Ons/System_ReturnToBlockland/sounds/synth4_12.wav"; | |
| description = AudioClose3d; | |
| preload = true; | |
| }; | |
| $MusicTones[0] = MusicLowC; | |
| $MusicTones[1] = MusicDb; | |
| $MusicTones[2] = MusicD; | |
| $MusicTones[3] = MusicEb; | |
| $MusicTones[4] = MusicE; | |
| $MusicTones[5] = MusicF; | |
| $MusicTones[6] = MusicGb; | |
| $MusicTones[7] = MusicG; | |
| $MusicTones[8] = MusicAb; | |
| $MusicTones[9] = MusicA; | |
| $MusicTones[10] = MusicBb; | |
| $MusicTones[11] = MusicB; | |
| $MusicTones[12] = MusicHighC; | |
| function PlaySong(%brick, %tempo, %loop) | |
| { | |
| if(!isObject(%brick)) return; | |
| if(isobject(%brick.song)) %brick.song.delete(); | |
| %song = new ScriptObject() { | |
| looping = %loop; | |
| tempo = (%tempo ? %tempo : 280); | |
| originalBrick = %brick; | |
| brickcount = 1; | |
| brick1 = %brick; | |
| }; | |
| %brick.song = %song; | |
| %song.nextmusicstep(); | |
| } | |
| function ScriptObject::NextMusicStep(%song) { | |
| if(!isObject(%song.originalbrick)) { | |
| %song.delete(); | |
| return; | |
| } | |
| for(%i = 1; %i <= %song.brickcount; %i++) { | |
| %brick = %song.brick[%i]; | |
| if(isObject(%brick)) { | |
| if(%brick.getcolorid() <= 12) schedule(10*%i, 0, "serverPlay3d", $MusicTones[%brick.getcolorid()], getwords(%song.originalbrick.gettransform(), 0, 2)); | |
| } | |
| } | |
| for(%i = 1; %i <= %song.brickcount; %i++) { | |
| %brick = %song.brick[%i]; | |
| if(isObject(%brick)) { | |
| for(%j = 0; %j < %brick.getnumupbricks() && %j < 5; %j++) { | |
| %bc++; | |
| %bg[%bc] = %brick.getupbrick(%j); | |
| } | |
| } | |
| %song.brick[%i] = ""; | |
| } | |
| %song.brickcount = (%bc > 5 ? 5 : %bc); | |
| for(%i = 1; %i <= %song.brickcount; %i++) { | |
| %song.brick[%i] = %bg[%i]; | |
| } | |
| if(%song.brickcount && !$stopmusic) %song.schedule(%song.tempo, "nextmusicstep"); | |
| else if(%song.looping && !$stopmusic) { | |
| %song.brick1 = %song.originalbrick; | |
| %song.brickcount = 1; | |
| %song.schedule(%song.tempo, "nextmusicstep"); | |
| } else %song.delete(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment