Beispiel #1
0
                                 outputs[:, i*block_size:(i+1)*block_size],
                                 block_size)
    print "Elapsed time:", (time.time() - start)

    #pyvst.save_wav_file("display_input.wav", inputs, sample_rate)
    #pyvst.save_wav_file("display_output.wav", outputs, sample_rate)

    return (input1, input2), outputs


#===============================================================================
if __name__ == "__main__":
    if len(sys.argv) > 1:
        plugin = pyvst.VSTPlugin(sys.argv[1])
    else:
        plugin = pyvst.VSTPlugin(get_platform_plugin("mda Delay"))

    plugin.open()
    plugin.set_sample_rate(sample_rate)
    plugin.set_block_size(block_size)
    plugin.resume()

    plugin.dump_properties()

    if plugin.has_editor():
        plugin.open_gui()

    if plugin.can_process_double():
        print "Testing with doubles (64bits)"
        inputs, outputs = process(plugin, numpy.float64)
    else:
Beispiel #2
0
    plugin.close()

def test_parameters(pluginpath):
    plugin = pyvst.VSTPlugin(pluginpath)
    plugin.set_parameter(1, 0.)
    assert plugin.get_parameter(1) == 0.
    plugin.set_parameter(1, 1.)
    assert plugin.get_parameter(1) == 1.

def test_programs(pluginpath):
    plugin = pyvst.VSTPlugin(pluginpath)
    plugin.set_program(10)
    print cast(pointer(plugin.get_program()), POINTER(c_void_p)).contents.value
    print pointer(c_int(10)).contents.value
    assert plugin.get_program() == pointer(c_int(10))
    plugin.set_program(0)
    assert plugin.get_program() == 0


#===============================================================================
if __name__ == "__main__":
    pluginpath = get_platform_plugin("mda DX10")

    test_load(pluginpath)
    test_check_magic(pluginpath)
    test_open_close(pluginpath)
    test_properties(pluginpath)
    test_resume_suspend(pluginpath)
    test_parameters(pluginpath)
    #test_programs(pluginpath)