<?php

$GLOBALS["uri_root"] = "/v";
$GLOBALS["system_root"] = ".";
require_once implode(DIRECTORY_SEPARATOR,
                    array($GLOBALS["system_root"], "src", "util.php"));

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <?php print_script_tag() ?>
    <title>Video Games</title>
    <?php print_link_tag("favicon.ico", "shortcut icon") ?>
    <?php print_link_tag("img/suPERA_Pantase.png", "image_src") ?>
    <?php print_link_tag("style.css", "stylesheet", "text/css") ?>
    <link rel="alternate" type="application/rss+xml" title="Alpha Omega in" 
          href="/feed.rss" />
  </head>

  <body>

    <!-- <?php print_r($_SERVER); ?> -->

    <div id="main">

      <div id="heading">

	<div id="syntax">
	  <?php include_syntax() ?>
	</div>

	<div class="title">
	  <div id="center">
            <a href="/">
	      <?php
                $ip = build_random_ip_address();
                print_l($ip);
              ?>
            </a>
	  </div>
	  <div id="left">
	    <?php print_l($ip); ?>
	  </div>
	  <div id="right">
	    <?php print_l($ip); ?>
	  </div>
	</div>
	<div class="title">
	  <div id="center">
            <a href="/">
	      <?php print_l($ip); ?>
            </a>
	  </div>
	  <div id="left">
	    <?php print_l($ip); ?>
	  </div>
	  <div id="right">
	    <?php print_l($ip); ?>
	  </div>
	</div>
	<div class="title">
	  <div id="center">
            <a href="/">
	      <?php print_l($ip); ?>
            </a>
	  </div>
	  <div id="left">
	    <?php print_l($ip); ?>
	  </div>
	  <div id="right">
	    <?php print_l($ip); ?>
	  </div>
	</div>

      </div>

      <div id="links">

	<div class="scanner">
	  <?php print_scanner_animation() ?>
	</div>

	<div id="menu">
	  <?php print_structures() ?>
	  <div>
	    <span class="heading">GAMES</span>
	    <a href="/games/esp/">E.S.P. Hadouken</a>
	    <a href="/games/evr/">Emoticon Vs. Rainbow</a>
	    <a href="/games/ong/">Ong</a>
	  </div>
	  <div>
	    <span class="heading">MUSIC</span>
	    <a href="/mix/1shot">One Shot</a>
	    <a href="/mix/grille">Grille</a>
	    <a href="/mix/space_dad">Space Dad</a>
	  </div>
	  <div>
	    <span class="heading">ETC.</span>
	    <a href="/visual/biolograms">Biolograms</a>
            <a href="/visual/portal">Portal</a>
	  </div>
	</div>

	<div class="scanner">
	  <?php print_scanner_animation() ?>
	</div>

      </div>

      <?php print_divider(); ?>

      <div id="log">
        <?php print_articles(); ?>
      </div>

      <div id="rss">
        <div>
          <?php print_rss_button_images(); ?>
        </div>
        <a href="/feed.rss">↠ RSS Feed ↞</a>
      </div>

      <!-- <table id="badge"> -->
      <!--   <tr> -->
      <!--     <td> -->
      <!--       <a href="http://kernel.org"><?php print_image_tag("img/badges/linux.png", "badge", "", false); ?></a> -->
      <!--     </td> -->
      <!--     <td> -->
      <!--       <a href="http://apache.org"><?php print_image_tag("img/badges/apache.png", "badge", "", false); ?></a> -->
      <!--     </td> -->
      <!--     <td> -->
      <!--       <a href="http://debian.org"><?php print_image_tag("img/badges/debian.png", "badge", "", false); ?></a> -->
      <!--     </td> -->
      <!--     <td> -->
      <!--       <a href="http://python.org"><?php print_image_tag("img/badges/python.png", "badge", "", false); ?></a> -->
      <!--     </td> -->
      <!--     <td> -->
      <!--       <a href="http://www.gnu.org/software/emacs/"><?php print_image_tag("img/badges/emacs.png", "badge", "", false); ?></a> -->
      <!--     </td> -->
      <!--     <td> -->
      <!--       <a href="http://gimp.org"><?php print_image_tag("img/badges/gimp.png", "badge", "", false); ?></a> -->
      <!--     </td> -->
      <!--   </tr> -->
      <!-- </table> -->

    </div>

  </body>

</html>
A_O.Syntax = function()
{
    this.loadElements();
    this.scroll();
}

A_O.Syntax.prototype.loadElements = function()
{
    var original = document.getElementById("syntax");
    original.style.top = A_O.build_px(0);
    this.height= original.offsetHeight;
    this.parent = original.parentNode;
    this.original = original;
    this.duplicate();
}

A_O.Syntax.prototype.duplicate = function()
{
    var clone = this.original.cloneNode(true);
    this.parent.appendChild(clone);
    this.clone = clone;
    this.jump();
}

A_O.Syntax.prototype.jump = function()
{
    var original = this.original;
    var height = this.height;
    var top = parseInt(original.style.top);
    var overflow = top + height;
    var place = overflow < 0 ? overflow : 0;
    original.style.top = A_O.build_px(place);
    this.clone.style.top = A_O.build_px(place + height);
}

A_O.Syntax.prototype.scroll = function()
{
    var current = this;
    window.setInterval(
	function()
	{
	    current.step();
	}, SYNTAX_SCROLL_INTERVAL);
}

A_O.Syntax.prototype.step = function()
{
    var step = SYNTAX_SCROLL_STEP;
    var original = this.original;
    var clone = this.clone;
    var o_top = parseInt(original.style.top) - step;
    var c_top = parseInt(clone.style.top) - step;
    original.style.top = A_O.build_px(o_top);
    clone.style.top = A_O.build_px(c_top);
    if (c_top < 0)
    {
	this.jump();
    }
}
18.97.14.83
18.97.14.83
18.97.14.83
 
September 13, 2013

from array import array
from time import sleep

import pygame
from pygame.mixer import Sound, get_init, pre_init

class Note(Sound):

    def __init__(self, frequency, volume=.1):
        self.frequency = frequency
        Sound.__init__(self, self.build_samples())
        self.set_volume(volume)

    def build_samples(self):
        period = int(round(get_init()[0] / self.frequency))
        samples = array("h", [0] * period)
        amplitude = 2 ** (abs(get_init()[1]) - 1) - 1
        for time in xrange(period):
            if time < period / 2:
                samples[time] = amplitude
            else:
                samples[time] = -amplitude
        return samples

if __name__ == "__main__":
    pre_init(44100, -16, 1, 1024)
    pygame.init()
    Note(440).play(-1)
    sleep(5)

This program generates and plays a 440 Hz tone for 5 seconds. It can be extended to generate the spectrum of notes with a frequency table or the frequency formula. Because the rewards in Send are idealized ocean waves, they can also be represented as tones. Each level has a tone in its goal and a tone based on where the player's disc lands. Both play at the end of a level, sounding harmonic for a close shot and discordant for a near miss. The game can dynamically create these tones using the program as a basis.

I'm also building an algorithmically generated song: Silk Routes (Scissored). Here is an example of how it sounds so far.