PortProperty in Max/Gen~ plugin

I did some editing in a Mag/Gen~ plugin .ttl file . Ok to get switches from knobs (adding lv2:portProperty lv2:integer, lv2:toggled) , but two problems trying editing time properties:

  1. I’d like to be able to get the host/mod tempo controlling the BPM
    Here is the original port :

lv2:port [
a lv2:InputPort, lv2:ControlPort ;
lv2:index 4 ;
lv2:name “BPM” ;
lv2:symbol “BPM” ;
lv2:default 120.000000 ;
lv2:minimum 40.000000 ;
lv2:maximum 200.000000 ;

And here is what I did try without success:

lv2:port [
a lv2:InputPort, lv2:ControlPort ;
lv2:index 4 ;
lv2:name “BPM” ;
lv2:symbol “BPM” ;
lv2:default 120.000000 ;
lv2:minimum 40.000000 ;
lv2:maximum 200.000000 ;
units:unit units:bpm ;
lv2:portProperty mod:tempoRelatedDynamicScalePoints;

or this,

lv2:portProperty http://moddevices.com/ns/mod#tempoRelatedDynamicScalePoints ;
according to this post Tap tempo for Max/gen~ - #4 by falkTX

  1. I’d like to have a selector switch for the tempo divisions
    Here is the original port :

a lv2:InputPort, lv2:ControlPort ;
lv2:index 5 ;
lv2:name “Div_L” ;
lv2:symbol “Div_L” ;
lv2:default 2.000000 ;
lv2:minimum 1.000000 ;
lv2:maximum 5.000000 ;

And the modification:

a lv2:InputPort, lv2:ControlPort ;
lv2:index 5 ;
lv2:name “Div_L” ;
lv2:symbol “Div_L” ;
lv2:default 2.000000 ;
lv2:minimum 1.000000 ;
lv2:maximum 5.000000 ;
lv2:portProperty lv2:enumeration, lv2:integer ;
lv2:scalePoint [
rdf:value 1 ;
rdfs:label “1/4” ;
rdfs:comment “Simple quarter notes.” ;
], [
rdf:value 2 ;
rdfs:label “1/8.” ;
rdfs:comment “Triplet quarter notes.” ;
], [
rdf:value 3 ;
rdfs:label “1/4T” ;
rdfs:comment “Simple eighth notes.” ;
], [
rdf:value 4 ;
rdfs:label “1/8” ;
rdfs:comment “Dotted eighth notes.” ;
], [
rdf:value 5 ;
rdfs:label “1/8T” ;
rdfs:comment “Triplet eighth notes.” ;
], [
rdf:value 6 ;
rdfs:label “1/16” ;
rdfs:comment “Sixteenth notes.” ;
], [
rdf:value 7 ;
rdfs:label “5tuplet” ;
rdfs:comment “Simple eighth notes.” ;
], [
rdf:value 8 ;
rdfs:label “7tuplet” ;
rdfs:comment “Dotted eighth notes.” ;
], [
rdf:value 9 ;
rdfs:label “9tuplet” ;
rdfs:comment “Triplet eighth notes.” ;
], [
rdf:value 10 ;
rdfs:label “11tuplet” ;
rdfs:comment “Sixteenth notes.” ;

In both cases it doesn’t work.
Some scripting problems ?

Any help appreciated…

Hi @zwabo,

For the translate to Tempo functionality, I think you need to add too some prefixes:

@prefix units: http://lv2plug.in/ns/extensions/units# .
@prefix mod: http://moddevices.com/ns/mod#.
@prefix time: http://lv2plug.in/ns/ext/time#.

I manage to add this to gxtubetremolo with following code:

    a lv2:InputPort ,
        lv2:ControlPort ;
    lv2:index 2 ;
    lv2:symbol "speed" ;
    lv2:name "Speed";
    lv2:default 0.1 ;
    lv2:minimum 0.1 ;
    lv2:maximum 14.0 ;
    units:unit units:hz ;
    lv2:portProperty  mod:tapTempo , mod:tempoRelatedDynamicScalePoints;

I suppose for BPM should work aswell…

2 Likes

YES, cool it works. Thanks a lot.

Does anyone know if there may also be a @prefix problem for

lv2:portProperty lv2:enumeration, lv2:integer ;
lv2:scalePoint [
rdf:value 1 ;
rdfs:label “1/4” ;
rdfs:comment “Simple quarter notes.” ;

etc… ??

1 Like

Yes, typically rdf one is not defined (not to be confused with rdfs), see how other plugins with list parameters do it.
You are very much welcome (and appreciated) to edit the MOD wiki entry on this.

2 Likes

Ok, thanks for your help, everything is fine for me now.
I did an edit to the Max gen~ - MOD Wiki
That’s the first time I did this so…let me know if it seems ok for you.

2 Likes

And I just added a tuto-video here :slight_smile:

enjoy

4 Likes