def index(): city = "" weather = weather_data.WeatherData("chicago", "city") if request.method == 'POST': city = request.form.get("city_holder", None) weather = weather_data.WeatherData(city, "city") (wtime, p) = weather.get_daytime() weather_icon = ("http://openweathermap.org/img/wn/%s%[email protected]" % (weather.get_weather_id(), "d" if wtime == "day" else "n" )) #times = NULL #weather = NULL beats.play(weather_data.WeatherData(city, "city")) def play_but_for_real(): #pygame.mixer.pre_init(44100, 16, 2, 4096) pygame.init() pygame.mixer.music.load("./music.mid") pygame.mixer.music.play() while pygame.mixer.music.get_busy(): pygame.time.wait(1000) play_but_for_real() return render_template('index.html', weather=weather)
def hi(): beat() play('Crash-01') beat() beat(3) play('Crash-01') beat()
def bar(): beat(2) beat(1) beat(2) beat(1) beat(1) beat(1) beat(0.5) beat(0.5) beat(1) beat(0.5) beat(0.5) beat(1) play('Crash-02')
def ting(): play('Kick-02', 0.5) play('Kick-02', 0.5) play('Kick-02') play('Kick-02') play('Kick-02', 0.5) play('Kick-02', 0.5) play('Kick-02') play('Kick-02') play('Kick-02', 0.5) play('Kick-02', 0.5) play('Kick-02', 2) play('Crash-02')
def bass(): play('Tom-05', 2) play('Tom-05', 0.5) play('Tom-05', 0.5) play('Tom-05') play('Tom-05', 2) play('Tom-05', 0.5) play('Tom-05', 0.5) play('Tom-05') play('Tom-05', 2) play('Tom-05', 0.5) play('Tom-05', 0.5) play('Tom-05')
def naa(): play('OpHat-01', 1)
def fud(): play('Kick-02', 1)