def OnInit():
    # Detects the device the script is running on
    detectDevice()

    # Tells to FL Studio the device has peak meters
    device.setHasMeters()

    # Activates the deep integration mode
    nihia.handShake()

    # Sets the lights on
    nihia.buttonSetLight("PLAY", 0)
    nihia.buttonSetLight("REC", 0)
    nihia.buttonSetLight("COUNT_IN", 0)
    nihia.buttonSetLight("STOP", 0)
    nihia.buttonSetLight("CLEAR", 1)
    nihia.buttonSetLight("LOOP", 0)
    nihia.buttonSetLight("METRO", 0)
    nihia.buttonSetLight("UNDO", 1)
    nihia.buttonSetLight("REDO", 1)
    nihia.buttonSetLight("QUANTIZE", 1)
    nihia.buttonSetLight("REDO", 1)
    nihia.buttonSetLight("TEMPO", 1)

    # Sets the lights of the 4D Encoder on S-Series keyboards on
    if DEVICE_SERIES == "S_SERIES":
        nihia.buttonSetLight("ENCODER_X_S", 1)
        nihia.buttonSetLight("ENCODER_X_S", 127)
        nihia.buttonSetLight("ENCODER_Y_S", 1)
        nihia.buttonSetLight("ENCODER_Y_S", 127)

    # Updates the device mixer
    updateMixer()
 def OnInit(self):
     if device.isAssigned():
         self.sysex(IMPULSE_INIT)
         self.encoderSwitcher.set(EncoderMode.Mixer)
         self.faderSwitcher.set(FaderMode.Mixer)
         self.lcdText(ui.getProgTitle())
         device.setHasMeters()
def OnInit():
    device.setHasMeters()
    global trackOffset
    trackOffset = 1
    if general.getVersion() >= minimumAPIVersion:
        setTrackData()
    else:
        raise Exception(
            "Your version of FL Studio is too old to use this script. Please update to a newer version."
        )
Example #4
0
	def OnInit(self):

		self.FirstTrackT[0] = 1
		self.FirstTrack = 0
		self.SmoothSpeed = 469
		self.Clicking = True

		device.setHasMeters()
		for m in range (0, len(self.FreeCtrlT)):
			self.FreeCtrlT[m] = 8192 # default free faders to center
		if device.isAssigned():
			for x in range(0, 8):
				device.midiOutSysex(bytes([0xF0, 0x00, 0x00, 0x66, 0x15, 0x0C, 1, 0xF7]))

		self.SetBackLight(2) # backlight timeout to 2 minutes
		self.UpdateClicking()
		self.UpdateMeterMode()

		self.SetPage()
		self.OnSendTempMsg('Linked to ' + ui.getProgTitle() + ' (' + ui.getVersion() + ')', 2000);
		print('OnInit ready')
def OnInit():
    device.setHasMeters()