Some basic questions
-
I agree that this feature has to be done. I've been looking a long time for this and it is very rare with mixed results. For synth leads and bass sounds it is invaluable. I do know it is possible as Korg, Roland, and especially Ensoniq keyboards can do this great with samples, but it is an invaluable feature.
Yes, coming up with an alternative way to accomplish the same tasks in HISE sounds good. I've been trying to think of some more specific examples where I use event IDs:
My main use for them at the moment is for a artificial legato and glide/portamento feature which relies on cross fading two notes and changing their pitches over time (in a loop). So that as the two notes cross fade their tunings also overlap until the note that fades out is tuned to the new note's starting tuning, and the new note's destination tuning is whatever key has been played - kind of hard to explain but this was used in the famous SIPS and WIPS KSP scripts to achieve a musical sounding legato effect.
In my true legato scripts I always turn off the old note before playing a new one (to prevent hanging notes) and some instruments I've worked on have same note legato transitions and the intervals are mapped to the same keys as the sustain notes (but in different groups) so I could end up with three samples triggering for one note but I only want to hear a max of two at a time (during cross fades) so I need to be able to turn the old ones off using their ID - if there are release samples too then things get more complex.
-
Hi, it seems you've made great progress with HISE since I last checked in! What's the latest with multi-mic sample sets?
-
Sorry for the late response, it got a bit quiet around here
Multimic samples are implemented, here is a blog post that describes the procedure:
-
Thanks, it looks pretty comprehensive. I'll have to test it out
-
Can the individual samples of a multi-mic sample have their start position offset?
What I'm thinking of here is if I record an instrument with close, stage, and far mics, they are going to be offset slightly with the mics farthest away the most delayed. When all mics are active this is fine but if, lets say, all the mics except the far mics are purged then there could be a noticeable delay between pressing the key and the start of the sample. So in this situation is might be nice for the user to be able to shift the start position of the sample.
-
I don't think this is practical. Moving the sample start means resetting all preload buffers (the beginning of the sample that resides in memory until the hard drive can fetch the rest).
If you really care about this delay, you could remove a fixed amount from the far sample (so that it is "in sync" with the close mic) and introduce a artificial delay using the delay FX, which can be altered on the fly.
-
Ah that sounds like a workable solution
-
What is about globals? I mean are they global for unique plugin or for any plugin in the project?
Generally, in the any future would be grate to have both separately, but now I need only to know :) -
Globals are only accessible in one plugin. Making shared stuff across different plugins in a DAW is a source of constant trouble so I wouldn't bother with this...
-
Might be possible in the HISE player though, no?
-
i'm trying to understand some basic concepts and can't assume, where I'm wrong here:
Here I'm trying to implement waitting, and expect that note would be delayed by 1 second but it isn't at all...<?xml version="1.0" encoding="UTF-8"?> <Processor Type="ScriptProcessor" ID="Script Processor6" Bypassed="1" Script="Globals.interval = 2; Globals.attack = false; Globals.legato = false; Globals.glissando = false; Globals.sus = false; var note = 0; var velocity = 0; var newnote = 0; var lastnote = 0; var i = 0; var prev_note = 0; var temp = 0; var rel_off = 0; var fading = 0; var fade_id = 0; var exit = 0; var wait = { 	ms:0, 	start:1, };function onNoteOn() { 	note = Message.getNoteNumber(); 	velocity = Message.getVelocity(); 	 	//if (lastnote = 0){ 		//Globals.attack = 1; 		//Globals.sus = 1; 	//}else { 	 	//}; 	Message.ignoreEvent(true); 	wait.start = 1; 	wait.ms = 1000; } function onNoteOff() { 	note = Message.getNoteNumber(); } function onController() { 	 } function onTimer() { 	if (wait.ms != 0){ 		if (wait.start == 1){ 			wait.ms = Engine.getSamplesForMilliSeconds(wait.ms); 			wait.start = 0; 		} 		if (wait.ms == 1){ 			Synth.playNote(note, velocity); 		} 		wait.ms -= 1; 	}; }; function onControl(number, value) { 	 } "> <EditorStates BodyShown="1" Visible="1" Solo="0" contentShown="0" onInitOpen="0" onNoteOnOpen="0" onNoteOffOpen="0" onControllerOpen="0" onTimerOpen="1" onControlOpen="0"/> <ChildProcessors/> <Content/> </Processor>
-
Well I'm not 100% sure what you're trying to do but you can't use the timer without starting it :) If you just want to delay note ons you might find what you need in my humaniser script - http://forum.hise.audio/topic/151/humaniser
Message.delayEvent(Engine.getSamplesForMilliSeconds(randNoteOnDelay));
-
just want to delay note
no, it's just smple visible action for debugging)))
use the timer without starting it
ahhh))) Thakns
-
what the difference between playNote and addNoteOn?
-
addNoteOn is more specialised, but internally they are the same.
-
agggr, I can't get it....
I have pretty simple on my taste task - take the attack sample (~0.7 sec), and sustain momentary, but sustain at -120dB then on last 0.3 sec of attack fade sus to 0dB. But it seems to me that callbacks on one event are executed consecutive, including to onNoteOff my wait function from onNoteOo, which using the timer callback.
I feel that it's not working like kontakt, and there should be way to implement such a thing, but any other thoughts bring me to the table envelopes with per-note changing the attack time and moving points (for avoide stretch of the fade area itself withtin changing attack time), that seems to me too complicated and unrelieble (more than, I can't get how to edit points on the specific attack table) :)
I feel myself so stupid.... -
function onNoteOn() { note = Message.getNoteNumber(); velocity = Message.getVelocity(); //if (lastnote = 0){ //Globals.attack = 1; //Globals.sus = 1; //}else { //}; Message.ignoreEvent(true); wait.start = 1; wait.ms = 10; Synth.startTimer(0.004); } function onTimer() { if (wait.ms != 0){ if (wait.start == 1){ wait.start = 0; } if (wait.ms == 1){ Synth.playNote(note, velocity); } wait.ms -= 1; }; };
P.S. It's just debugging code for understanding how things are working, but even here I'm confused)))
P.P.S.
take the attack sample (~0.7 sec), and sustain momentary
Why this way? From my experience momentary taking two samples produces less bugs and less code, than moving sustain noteOn in time
-
Well, Now I'm almost sure about logic and syntax, but while loop terminates.
var wait = 0; const var timer = Engine.createTimerObject(); timer.callback = function() { wait = wait - 1; if (wait == 0){ timer.stopTimer; } }; function onNoteOn() { note = Message.getNoteNumber(); velocity = Message.getVelocity(); Message.ignoreEvent(true); wait = 2; timer.startTimer(150); // in milliseconds while (wait > 0){ } Synth.playNote(note, velocity); }
-
I'm still not really sure what the purpose of this is but this should help:
<?xml version="1.0" encoding="UTF-8"?> <Processor Type="SynthChain" ID="Master Chain" Bypassed="0" Gain="1" Balance="0" VoiceLimit="128" KillFadeTime="20" IconColour="0" packageName="" views="32.rk1bzA.....B.........LUYtQFL..+O..........." currentView="-1"> <EditorStates BodyShown="0" Visible="1" Solo="0" Folded="0"/> <ChildProcessors> <Processor Type="MidiProcessorChain" ID="Midi Processor" Bypassed="0"> <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/> <ChildProcessors/> </Processor> <Processor Type="ModulatorChain" ID="GainModulation" Bypassed="0" Intensity="1"> <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/> <ChildProcessors/> </Processor> <Processor Type="ModulatorChain" ID="PitchModulation" Bypassed="1" Intensity="0"> <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/> <ChildProcessors/> </Processor> <Processor Type="EffectChain" ID="FX" Bypassed="0"> <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/> <ChildProcessors/> </Processor> <Processor Type="SineSynth" ID="Sine Wave Generator" Bypassed="0" Gain="0.25" Balance="0" VoiceLimit="128" KillFadeTime="20" IconColour="0" OctaveTranspose="0" SemiTones="0" UseFreqRatio="0" CoarseFreqRatio="1" FineFreqRatio="0" SaturationAmount="0"> <EditorStates BodyShown="1" Visible="1" Solo="0" GainModulationShown="1"/> <ChildProcessors> <Processor Type="MidiProcessorChain" ID="Midi Processor" Bypassed="0"> <EditorStates BodyShown="1" Visible="1" Solo="0" Folded="0"/> <ChildProcessors> <Processor Type="ScriptProcessor" ID="Time Delay" Bypassed="0" Script="reg id; reg note; reg velo; reg waitTime = 0.5; //ms reg timePassed;function onNoteOn() { 	Message.ignoreEvent(true); 	 	note = Message.getNoteNumber(); 	velo = Message.getVelocity(); 	 	timePassed = 0; 	Synth.startTimer(0.05); } function onNoteOff() { 	Synth.noteOffByEventId(id); } function onController() { 	 } function onTimer() { 	timePassed = timePassed + 0.05; 	 	if (timePassed >= waitTime) 	{ 		id = Synth.playNote(note, velo); 		Synth.stopTimer(); 	}	 } function onControl(number, value) { 	 } "> <EditorStates BodyShown="1" Visible="1" Solo="0" contentShown="1" onInitOpen="0" onNoteOnOpen="0" onNoteOffOpen="0" onControllerOpen="0" onTimerOpen="1" onControlOpen="0"/> <ChildProcessors/> <Content/> </Processor> </ChildProcessors> </Processor> <Processor Type="ModulatorChain" ID="GainModulation" Bypassed="0" Intensity="1"> <EditorStates BodyShown="1" Visible="0" Solo="0"/> <ChildProcessors> <Processor Type="SimpleEnvelope" ID="DefaultEnvelope" Bypassed="0" Intensity="1" Attack="5" Release="10" LinearMode="1"> <EditorStates BodyShown="1" Visible="1" Solo="0"/> <ChildProcessors> <Processor Type="ModulatorChain" ID="Attack Time Modulation" Bypassed="0" Intensity="1"> <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/> <ChildProcessors/> </Processor> </ChildProcessors> </Processor> </ChildProcessors> </Processor> <Processor Type="ModulatorChain" ID="PitchModulation" Bypassed="0" Intensity="0"> <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/> <ChildProcessors/> </Processor> <Processor Type="EffectChain" ID="FX" Bypassed="0"> <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/> <ChildProcessors/> </Processor> </ChildProcessors> <RoutingMatrix NumSourceChannels="2" Channel0="0" Send0="-1" Channel1="1" Send1="-1"/> </Processor> </ChildProcessors> <RoutingMatrix NumSourceChannels="2" Channel0="0" Send0="-1" Channel1="1" Send1="-1"/> <macro_controls> <macro name="Macro 1" value="0" midi_cc="-1"/> <macro name="Macro 2" value="0" midi_cc="-1"/> <macro name="Macro 3" value="0" midi_cc="-1"/> <macro name="Macro 4" value="0" midi_cc="-1"/> <macro name="Macro 5" value="0" midi_cc="-1"/> <macro name="Macro 6" value="0" midi_cc="-1"/> <macro name="Macro 7" value="0" midi_cc="-1"/> <macro name="Macro 8" value="0" midi_cc="-1"/> </macro_controls> <MidiAutomation/> </Processor>
-
Thank You! I assume this code, thank God, something like this have worked, but are you using timer for stopping callback for a while?
This is the main purpose of wait))
For continue executing callback after "wait" function. Many of concepts in my head are still connected with time