Kontakt KSP - How to release previous generated (scripted) notes?

Sampler and Sampling discussion (techniques, tips and tricks, etc.)
Post Reply New Topic
RELATED
PRODUCTS

Post

This is the "pseudo-Nils-code" I've made:

Code: Select all

on init	
	declare status :=1
	declare index
	declare note_numbers := 9

	declare note_delay
	declare note_cc
	declare note_vel
	declare note_offset
	declare note_rel

	set_listener (NI_SIGNAL_TRANSP_START, 1)
	set_listener (NI_SIGNAL_TRANSP_STOP, 1)

	message("")
	make_perfview
end on

on listener
	select (NI_SIGNAL_TYPE)
		case NI_SIGNAL_TRANSP_START
			message ("Playback was started.")			
			status := 1		
		case NI_SIGNAL_TRANSP_STOP
			message ("Playback was stopped.")
			status := 0
	end select
end on

function createNote()
	note_delay := random(0, 100000)
	wait(note_delay)

	if (status = 1)
		note_cc := random(20, 70)
		note_vel := random(60, 127)
		note_offset := random(0, 1000000)
		note_rel := random(0, 5000000)
		play_note(note_cc, note_vel, 0, note_rel) 
		message("note_cc: "& note_cc)
	end if
end function

on note
	index := 0
	while(index < note_numbers)
		createNote()
		inc(index)
	end while 	
end on
every Time I hit a note, I create 9 random notes, with different delays using wait(), and different vel/cc/rel for each note.

What I'd like is that when I stop the DAW, it releases the current generated notes. I'm able to stop the "following ones" (with the "status" flag), but what about the ones that are ringing on? Is there a way to totally/brutally break also those notes?

Thanks!

Post

Easiest way to kill all notes is fade_out($ALL_EVENTS,1000,1).

Post

I'll try it out! Thank you! Anyway, I'm able to output generated notes but not CC, as for the other topic.
Is there any other reasons that could cause this? I can't sort it out :ud:

Post

No idea, I guess it depends on how host handles MIDI sent by plugins...

Post

I open a ticket to FL Studio. It used to works on v.11. Thank you anyway, huge help to me dude!

Post Reply

Return to “Samplers, Sampling & Sample Libraries”