# Path: mingus/midi/fluidsynth.py
# class FluidSynthSequencer(Sequencer):
# 	def init(self):
# 	def __del__(self):
# 	def start_audio_output(self, driver=None):
# 	def load_sound_font(self, sf2):
#         def play_event(self, note, channel, velocity):
#         def stop_event(self, note, channel):
#         def cc_event(self, channel, control, value):
#         def instr_event(self, channel, instr, bank):
# def init(sf2, driver = None):
# def play_Note(note, channel = 1, velocity = 100):
# def stop_Note(note, channel = 1):
# def play_NoteContainer(nc, channel = 1, velocity = 100):
# def stop_NoteContainer(nc, channel = 1):
# def play_Bar(bar, channel = 1, bpm = 120):
# def play_Bars(bars, channels, bpm = 120):
# def play_Track(track, channel = 1, bpm = 120):
# def play_Tracks(tracks, channels, bpm = 120):
# def play_Composition(composition, channels = None, bpm = 120):
# def control_change(channel, control, value):
# def set_instrument(channel, midi_instr):
# def stop_everything():
# def modulation(channel, value):
# def pan(channel, value):
# def main_volume(channel, value):
# def set_instrument(channel, instr, bank = 0):


import pygame
from pygame.locals import *
from mingus.containers import *
from mingus.midi import fluidsynth
from os import sys


def play_note(note):
	"""play_note determines which pad was 'hit' and send the 
	play request to fluidsynth"""

	index = None
	if note == Note("B", 2):
		index = 0
	elif note == Note("A", 2):
		index = 1
	elif note == Note("G", 2):
		index = 2
	elif note == Note("E", 2):
		index = 3
	elif note == Note("C",2):
		index = 4
	elif note == Note("A", 3):
		index = 5
	elif note == Note("B", 3):
		index = 6
	elif note == Note("A#", 2):
		index = 7
	elif note == Note("G#", 2):
		index = 8

	if index != None and status == "record":
		playing.append([index, tick])
		recorded.append([index, tick, note])
		recorded_buffer.append([index, tick])

# Path: mingus/midi/fluidsynth.py
# class FluidSynthSequencer(Sequencer):
# 	def init(self):
# 	def __del__(self):
# 	def start_audio_output(self, driver=None):
# 	def load_sound_font(self, sf2):
#         def play_event(self, note, channel, velocity):
#         def stop_event(self, note, channel):
#         def cc_event(self, channel, control, value):
#         def instr_event(self, channel, instr, bank):
# def init(sf2, driver = None):
# def play_Note(note, channel = 1, velocity = 100):
# def stop_Note(note, channel = 1):
# def play_NoteContainer(nc, channel = 1, velocity = 100):
# def stop_NoteContainer(nc, channel = 1):
# def play_Bar(bar, channel = 1, bpm = 120):
# def play_Bars(bars, channels, bpm = 120):
# def play_Track(track, channel = 1, bpm = 120):
# def play_Tracks(tracks, channels, bpm = 120):
# def play_Composition(composition, channels = None, bpm = 120):
# def control_change(channel, control, value):
# def set_instrument(channel, midi_instr):
# def stop_everything():
# def modulation(channel, value):
# def pan(channel, value):
# def main_volume(channel, value):
# def set_instrument(channel, instr, bank = 0):


# Path: mingus_examples/pygame-drum/pygame-drum.py
import pygame
from pygame.locals import *
from mingus.containers import *
from mingus.midi import fluidsynth
from os import sys



def play_note(note):
	"""play_note determines which pad was 'hit' and send the 
	play request to fluidsynth"""

	index = None
	if note == Note("B", 2):
		index = 0
	elif note == Note("A", 2):
		index = 1
	elif note == Note("G", 2):
		index = 2
	elif note == Note("E", 2):
		index = 3
	elif note == Note("C",2):
		index = 4
	elif note == Note("A", 3):
		index = 5
	elif note == Note("B", 3):
		index = 6
	elif note == Note("A#", 2):
		index = 7
	elif note == Note("G#", 2):
		index = 8

	if index != None and status == "record":
		playing.append([index, tick])
		recorded.append([index, tick, note])
		recorded_buffer.append([index, tick])

	fluidsynth.play_Note(note, 9, 100)