def stopSession():
    """This got registered with atexit in the nsm new or open callback above.
    will handle all python exceptions, but not segfaults of C modules. """
    print()
    print("Starting Quit through @atexit, stopSession")
    starttime = datetime.now()
    #Don't do that. We are just a client.
    #cbox.Transport.stop()
    #print("@atexit: Calfbox Transport stopped ")
    cbox.stop_audio()
    print("@atexit: Calfbox Audio stopped ")
    cbox.shutdown_engine()
    print("@atexit: Calfbox Engine shutdown ")
    endtime = datetime.now() - starttime
    print (f"Shutdown took {endtime.seconds} seconds for {NUMBER_OF_INSTRUMENTS} instruments")
Exemplo n.º 2
0
def exit_handler():
    #Restore initial state and stop the engine
    cbox.Transport.stop()
    cbox.stop_audio()
    cbox.shutdown_engine()
Exemplo n.º 3
0
def shutdownCbox():
    cbox.Transport.stop()
    cbox.Transport.seek_ppqn(0)
    cbox.stop_audio()
    cbox.shutdown_engine()
Exemplo n.º 4
0
        ])
        song.set_mti(65, 0.0, 0, 0)
        self.assertEqual(song.status().mtis,
                         [MtiItem(0, 120.0, 0, 0),
                          MtiItem(90, 180.0, 0, 0)])
        song.set_mti(68, 0.0, 0, 0)
        self.assertEqual(song.status().mtis,
                         [MtiItem(0, 120.0, 0, 0),
                          MtiItem(90, 180.0, 0, 0)])
        song.set_mti(0, 0.0, 0, 0)
        self.assertEqual(song.status().mtis,
                         [MtiItem(0, 0, 0, 0),
                          MtiItem(90, 180.0, 0, 0)])
        song.set_mti(90, 0.0, 0, 0)
        self.assertEqual(song.status().mtis, [MtiItem(0, 0, 0, 0)])

    def test_error(self):
        thrown = False
        try:
            Document.get_scene().cmd('transpose', None, cbox)
        except ValueError as ve:
            self.assertTrue("class 'module'" in str(ve))
            thrown = True
        self.assertTrue(thrown)


unittest.main()

cbox.stop_audio()
cbox.shutdown_engine()
Exemplo n.º 5
0
def shutdownCbox():
    cbox.Transport.stop()
    cbox.Transport.seek_ppqn(0)
    cbox.stop_audio()
    cbox.shutdown_engine()
Exemplo n.º 6
0
def shutdownCbox():
    cbox.stop_audio()
    cbox.shutdown_engine()
Exemplo n.º 7
0
            [MtiItem(0, 120.0, 0, 0), MtiItem(60, 180.0, 0, 0), MtiItem(65, 210.0, 0, 0), MtiItem(90, 180.0, 0, 0)],
        )

        song.set_mti(60, 0.0, 0, 0)
        self.assertEqual(
            song.status().mtis, [MtiItem(0, 120.0, 0, 0), MtiItem(65, 210.0, 0, 0), MtiItem(90, 180.0, 0, 0)]
        )
        song.set_mti(65, 0.0, 0, 0)
        self.assertEqual(song.status().mtis, [MtiItem(0, 120.0, 0, 0), MtiItem(90, 180.0, 0, 0)])
        song.set_mti(68, 0.0, 0, 0)
        self.assertEqual(song.status().mtis, [MtiItem(0, 120.0, 0, 0), MtiItem(90, 180.0, 0, 0)])
        song.set_mti(0, 0.0, 0, 0)
        self.assertEqual(song.status().mtis, [MtiItem(0, 0, 0, 0), MtiItem(90, 180.0, 0, 0)])
        song.set_mti(90, 0.0, 0, 0)
        self.assertEqual(song.status().mtis, [MtiItem(0, 0, 0, 0)])

    def test_error(self):
        thrown = False
        try:
            Document.get_scene().cmd("transpose", None, cbox)
        except ValueError as ve:
            self.assertTrue("class 'module'" in str(ve))
            thrown = True
        self.assertTrue(thrown)


unittest.main()

cbox.stop_audio()
cbox.shutdown_engine()
Exemplo n.º 8
0
def exit_handler():
    #Restore initial state and stop the engine
    cbox.Transport.stop()
    cbox.stop_audio()
    cbox.shutdown_engine()