Forum Archive

Starting a parallel thread from the scene

laszlo.j.hermann

Is there any way to start a parallel thread from the scene?

omz

Could you be a bit more specific, i.e. what are you trying to accomplish? In general, you should be able to use the threading module as usual, but I can't think of a lot of use cases, except for maybe the AI in a turn-based-game or something like that.

laszlo.j.hermann

I want to start the play function of the "mido" Python Module on a loaded Midi file from a scene and visualize and play the messages by filling a list of the Midi nodes. Parallel I want be able to play my nodes by touching the screen like in the piano.py. If I start a loop directly from a scene the "touch_began" doesn't catch the messages until the loop ended. Probably I need to start / stop a parallel Thread to play the MidiFile and be able record my nodes in the same time.

laszlo.j.hermann

I figured out. Now I can read, write, realtime (play, record) and edit MIDI files :-)

ccc

@laszlo-j-hermann Is your solution open source (can we see?) or not?