What's new

Multiple Waveforms

jfino

Member
Hi Everyone,

I want to have couple of waveforms on display and each with its own independent play cursor.
Each sample is mapped on a different key.

I tried the code below but something is not right..
Any advice would be very helpful.

Thanks so much!!

Code:
on init
    set_ui_height_px(350)

    declare $play_pos
    declare ui_waveform $Waveform(6,6)
    attach_zone ($Waveform,find_zone ("Sample1"),0)
   
    declare $play_pos2
    declare ui_waveform $Waveform2(6,6)
    attach_zone ($Waveform2,find_zone ("Sample2"),0)


end on

on note

    while ($NOTE_HELD = 1)
        $play_pos := get_event_par($EVENT_ID,$EVENT_PAR_PLAY_POS)
        set_ui_wf_property($Waveform,$UI_WF_PROP_PLAY_CURSOR,0,$play_pos)

       $play_pos2 := get_event_par($EVENT_ID,$EVENT_PAR_PLAY_POS)
        set_ui_wf_property($Waveform2,$UI_WF_PROP_PLAY_CURSOR,0,$play_pos2)
        wait (10000)
    end while
end on
 
Last edited:

P.N.

Senior Member
Hi.

I made something like this a while ago with up to 25 simultaneous waveforms, but i took a different aproach.

I redefined the event id and used the LCB, not a wait command. I also didn't use the $NOTE_HELD command, but a variable that activates the waveform in the LCB (and i do believe i didn't use one in the RCB, for some reasons i don't remember).

So, you could do something similar for your case. Have 2 variables that activate the waveform in the LCB, and you may use those 2 same variables in the RCB to stop/reset the waveforms.
 
OP
jfino

jfino

Member
Thanks guys! I will try out your suggestions later on today.
I've never used the Listener CB but I saw an example in the manual.
 

P.N.

Senior Member
Here's another cool thing you could try out, if you're feeling adventurous.

Instead of having the 2 waveforms idle, you could have them on top of each other, and only the relevant one appears when activated. If the 2 notes that activate the waveform are pressed at the same time, you could have a script that resizes them both on the fly (and moves one of them), so that you have a dynamic interface.
You'll see them both, but with a smaller size.

I did something like this before, and it's actually pretty cool to look at, while keeping a cleaner GUI.

It's just an idea. It all depends on your goals and the rest of your interface. :)
 
OP
jfino

jfino

Member
Here's another cool thing you could try out, if you're feeling adventurous.

Instead of having the 2 waveforms idle, you could have them on top of each other, and only the relevant one appears when activated. If the 2 notes that activate the waveform are pressed at the same time, you could have a script that resizes them both on the fly (and moves one of them), so that you have a dynamic interface.
You'll see them both, but with a smaller size.

I did something like this before, and it's actually pretty cool to look at, while keeping a cleaner GUI.

It's just an idea. It all depends on your goals and the rest of your interface. :)
Cool idea P.N!
 
Top Bottom