Thread: Midi <-> OSC
View Single Post
Old 11-20-2017, 08:55 AM   #113
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 12,438
Default

Quote:
Originally Posted by fundorin View Post
In which section of the script should I put this code?
I want slStartup() function to run on midi port reopen.
When placed in to @init section, code run just once, on start of the oscii-bot, or when "script reload" is pressed.
Am I wrong, thinking that "dev" variable is an alias for device name? Tried leaving it as dev and renaming to my midi device in alias.

Code:
(tmp = get_device_open_time(midi_in)) > dev_last_time ? (
  dev_last_time = tmp;
  printf("reinitializing dev\n"); // executes on initial open and any subsequent re-opens
  slStartup();
  // ... midisend(dev);
);
@timer preferably
Justin is offline   Reply With Quote