CHOP Inline Code Vex Code question

   2784   3   1
User Avatar
Member
68 posts
Joined: May 2013
Offline
In V 13 inside a CHOP Network (with a MIDI channel input from file),
which also has a VOPChop which contains an “Inline Code” node.
Should I not be able to do something like this?

if(@L == 0) @name = “Empty_” + @name;

Ultimately looking to delete channels that have no activity (potentially above a threshold.) I'm sure there's other ways but it's a start at putting inline Vex Code. I guess they are not VEX Expressions or something is there a vex Expression node in chop networks cause I can't find it?
There is a “VEX” node but it only takes a script file vex or vfl or something odd and unfamiliar.
User Avatar
Member
68 posts
Joined: May 2013
Offline
I so far have tried putting a (VEX?) “Snippet” node inside the vopchop with…

if(@L == 0) {
string @name = “Empty_” + @name;
}


You can also ‘compare’ the global L and set the “Variable Name 1” in the Snippet to ‘empty’…

if(empty) string @name = “Empty_” + @name;

I also set the “Bindings to Export” to @name but nothing changes.

both have this the same problem…
Warning: Declaration of variable ‘bound_name’ shadows a previous declaration at line 25 in ‘/ch/ch1/vopchop1’


I'm unclear on overwriting permissions, or global reference declaration or what gives? ops:

is it even the “@name” field I want?! {I've tried @chan and @vex_name too now}

I also wondered if you could simply delete the channel at this point, instead of later in a Delete node via the Empty name matching?

and where would you scan all of them best? when loading, or a ‘for each’ etc.

could you do it from a Rename node by putting python in the from and to fields?
User Avatar
Member
68 posts
Joined: May 2013
Offline
In a Delete node I've put the “Channel Completely Within Range” values 0 and 0
to delete midi channels without any activity.

Still the conclusion I have is @name is not changeable in this situation.
I would like to still make it work that way?

Mainly because I wish to delete the inactive channels based on activity at the current time (or slightly before and after potentially).
User Avatar
Member
68 posts
Joined: May 2013
Offline
Well I've made some progress.
The thing I still struggle with I think is an instinct (as a programmer), to make a loop of items, and as obvious a route that would likely be and probably is still somehow possible, it's not really the intention (nor clear) as it's already done for you.

I moved to a technique of renaming the remaining channels in the chop to just the note numbers (what I want but for only active channels ideally), but leave them intact (none efficient but so far unavoidable for me at chop level).
Then in the SOP using the tried & true Copy Stamp routine.


cn = node(“/ch/midiIn/OUT”)
ptnum = int(lvar(“PT”))
ct = cn.tracks()
noteNum = int(ct.name())
note = (noteNum % 12)



…and so on goes the personal challenge of the day/week/month.
  • Quick Links