예제 #1
0
def main():
    fgen = FunctionGenerator(1)  # Instantiate function generator
    fgen.reset()
    print(fgen.getIdn())
    fgen.setOutput(1, 'OFF')
    fgen.setOutput(2, 'OFF')
    fgen.loadSettings('params.txt')
    print(fgen.getError())  # Gets error off the queue
예제 #2
0
def main():
    fgen = FunctionGenerator(1)  # Instantiate function generator
    print(fgen.getIdn())  # Print identity of function generator
    # fgen.pushSin(20)
    # fgen.loadFromMemory("HIFU_SIM") # Loads the stored config "HIFU_SIM"
    fgen.pushArbitraryWaveform(list(np.linspace(-2000, 2000, 200, dtype=np.int)))
    print(fgen.getError())  # Gets error off the queue
    print(list(np.linspace(-2000, 2000, 100, dtype=np.int16)))
def main():
    fgen = FunctionGenerator(1)  # Instantiate function generator
    fgen.reset()
    print(fgen.getIdn())
    fgen.setOutput(1, 'OFF')
    fgen.setOutput(2, 'OFF')
    fgen.loadSettings('params.txt')
    print(fgen.getError())  # Gets error off the queue
예제 #4
0
def main():
    fgen = FunctionGenerator(1)  # Instantiate function generator
    print(fgen.getIdn())  # Print identity of function generator
    # fgen.pushSin(20)
    # fgen.loadFromMemory("HIFU_SIM") # Loads the stored config "HIFU_SIM"
    fgen.pushArbitraryWaveform(
        list(np.linspace(-2000, 2000, 200, dtype=np.int)))
    print(fgen.getError())  # Gets error off the queue
    print(list(np.linspace(-2000, 2000, 100, dtype=np.int16)))
예제 #5
0
        return False
    if (args.zeros_range < 1 or args.zeros_range > 1000):
        print("Wrong range of zero places")
        return False
    if (args.field < 10 or args.field > 10000):
        print("Wrong field of the function")
        return False
    if (args.notes_amount < 10 or args.notes_amount > 10000):
        print("Wrong notes amonut")
        return False
    return True


argparser = ArgumentParser(
    description='Generate some crazy music based on mathematics (math is crazy)'
)
argparser = add_arguments(argparser)

args = argparser.parse_args()

if (check_arguments(args)):
    function_generator = FunctionGenerator(args.zeros_range, args.zeros_amount)
    function = function_generator.generate_function()
    note_generator = NoteGenerator(args.field, args.notes_amount)
    notes = note_generator.generate_notes(function)

    file_name = args.name + ".mid"
    song_generator = SongGenerator(file_name, args.speed, args.mode,
                                   args.notes_range, notes)
    song_generator.generate_song()
예제 #6
0
from FunctionGenerator import FunctionGenerator
fgen = FunctionGenerator(1)  # Instantiate function generator
fgen.instr.write('TRIGGER1:SOURCE BUS') # Make sure that outputs are on
fgen.instr.write('TRIGGER2:SOURCE BUS')
fgen.sendTrigger()
user_input = re.split(",", user_input)

''' Convert the data from a string array to an int array '''
user_input = map(int, user_input)

''' Make sure user input is more than one number. '''
if len(user_input) <= 1:
    print "Too few inputs provided. Program will now terminate."
    MyTimer.terminate_program()

derivative = Derivative(user_input)

data = derivative.get_data()

data_for_function_generator = []

for x in range(len(data[0])):
    data_for_function_generator.append(data[0][x])

derivative.print_info()
#derivative.attempt_solution()

function_generator = FunctionGenerator(data_for_function_generator)
function_generator.attempt_to_find_math_function_for_data()

MyTimer.terminate_program()

#TODO: Check for fibonacci sequence

#TODO: Check for repeating patterns
예제 #8
0
from FunctionGenerator import FunctionGenerator
fgen = FunctionGenerator(1)  # Instantiate function generator
fgen.instr.write('TRIGGER1:SOURCE BUS')  # Make sure that outputs are on
fgen.instr.write('TRIGGER2:SOURCE BUS')
fgen.sendTrigger()