Monophonic behaviour ?



  • I am making a samplemap for a monophonic synth.

    If I set it to 2 voice it seems to behave monophonically somewhat but does not seem to change a lot when set to 5 voices , still being monophonic ? Can play 2 notes when the voice amount is 6 .Bit confusing ?

    What I would like to achieve as follows.

    1. low note priority , so playing and holding C and then playing C# will not play a note , playing and holding C and then B will play a note.

    2.If I play one C note , hold it, and then a play a lower note B it will override the first , but when I let go of B it will play the held C note.

    The Legato with Retrigger gets halfway there but has no note poriority.

    Is this possible somehow in Hise ?



  • Sounds like you just need a note filter.

    Something like this:

    if (noteB > noteA)
        Message.ignoreEvent(true);
    

    You'll need to handle the setting and unsetting of the two variables in the on note on and on note off callbacks.



  • I see, thanks !



  • @d-healey Still struggling with this , I suck at programming !

    I get that I should program it so that is note B is ignored if it is higher then note A.
    But how do I implement that ? How can I ask HISE which note is played first ? I must be missing something here ?



  • @lalalandsynth - us e the note on call back and record the last played note...then compare lastPlayedNote against the current note



  • Store the last note that was played in a variable.

    So in onNoteOn you'd have something like this

        if (Message.getNoteNumber() > lastNote)
            Message.ignoreEvent(true);
    
        lastNote = Message.getNoteNumber();
    

    You need to declare lastNote as a reg variable in your on init callback. All of this should be in a separate realtime script (not in your interface script which should be deferred).



  • @d-healey said in Monophonic behaviour ?:

    All of this should be in a separate realtime script (not in your interface script which should be deferred).

    So to be clear when you say separate realtime script , does that mean just an external script and I point to that in the oninit of the Midiprocessor/scriptprocessor ? What exactly does the word deferred mean ?



  • @lalalandsynth

    does that mean just an external scrip

    No, it means you add another MIDI processor into your project

    ? What exactly does the word deferred mean ?

    https://forum.hise.audio/topic/79/scripting-best-practices



  • @d-healey ok, I think I understand. In this case I am not using any knobs from the interface script to enable or disable this function. I am assuming that is what the deferred thing is for?



  • @d-healey said in Monophonic behaviour ?:

    if (Message.getNoteNumber() > lastNote)
    Message.ignoreEvent(true);

    lastNote = Message.getNoteNumber();
    

    This will only work for the first time , that is , I play and hold one note , then a higher note and it works .
    But If I hold the first lower note , then play the upper note twice it will play the upper note on the second play.
    Which makes sense when its only looking at the last note , but not true low note priority .



  • @lalalandsynth You should defer your UI script anyway, unless you have a good reason not to 😄

    But If I hold the first lower note , then play the upper note twice it will play the upper note on the second play

    Hmm this becomes more complicated because now you need to keep track of all held notes.



  • I have an idea, let me know if it works

        if (Message.getNoteNumber() > lastNote)
            Message.ignoreEvent(true);
    
        if (Message.getNoteNumber() < lastNote)
            lastNote = Message.getNoteNumber();
    


  • @d-healey said in Monophonic behaviour ?:

    if (Message.getNoteNumber() > lastNote)
    Message.ignoreEvent(true);

    if (Message.getNoteNumber() < lastNote)
        lastNote = Message.getNoteNumber();
    

    No, I get no notes like that .

    Also the first version does not take into account whether the note is held , so if I play a lower note, let go of it , it will not play an upper note until the second time I play it. So basically if I play from C1 to C2 I have to play each note twice to hear it.

    What it should do is ignore an upper note only if an lower note is held .



  • @lalalandsynth With my previous example try intializing lastNote to 128 (probably still won't work but worth a try).


Log in to reply
 

14
Online

1.2k
Users

3.8k
Topics

33.7k
Posts