Is there a way to get [qlist] to import information off a text file as a list of symbols and floating points? The only way given in any of the examples has been using the print object (which displays the information, but won't let me compute with it?) or using the receive object [r] and I can't use that in this instance.
Any help would be greatly appreciated!
-
Reading in a list of symbols with qlist
-
perhaps this will show you EXACTLY what i would like to do? could you possibly edit this patch so it works?
-
@AWilliams Maybe something like this?
-
Or a fancy gui version if you prefer:
Here's the .zip: dynamic-snd-rcv.zip
Basically [s$] works by packing a float and a symbol into a list, such that any random float has a unique, user-definable identifier to go with it. [r$] initially listens to all data coming via the [s a-list]/[r a-list] pair (which are inside the abstractions), but then filters out based on what symbol you tell it to look for. You can define [r$] by clicking the L and then sending whatever data you want through a [s$] , or just typing it in manually. Long story short you can now dynamically define a [receive]Because this is just proof on concept, and because I really should be starting on my university homework, I limited the amounts of data you can send through (which is 1 float). If you wanted to send more data through, you'll need to find a way to send a separate list of floats/symbols/whatever that you would pack BEFORE giving it to [s$] to pack with your "symbol argument".
Btw, the name "a-list" is completely arbitrary. It just can't be "$0-list" because the abstractions will have different $0 values and won't talk to each other.
-
Yes... homework before homeplay!
Try this.. it half does what you want.. it's a start as they say. It will build a filing cabinet. Not a list as such. A list could be built afterwards from the filing cabinet, then the items in the list could be found using [slist], but sorting the list afterwards? More work.
new try.zip
I will try to build in a way to update the contents of each drawer when I get the time. That should be easy, as I have mentioned in the patch comment.
The drawers in the cabinet could be made to send their contents to different places when they are called (by [r index$1]), by using [s $1-list], instead of [s a-list]. The fifth drawer (drawer (5 symbol)) would send "5 symbol" to [s 5-list]...... if you wish. -
@whale-av said:
The drawers in the cabinet could be made to send their contents to different places when they are called (by [r index$1]), by using [s $1-list], instead of [s a-list]. The fifth drawer (drawer (5 symbol)) would send "5 symbol" to [s 5-list]...... if you wish.
I guess I'm confused as to what you are trying to do. I looked at your example but I couldn't understand why you need a dynamically changing receive. After I entered a float and symbol pair into the send, it entered the same symbol in the receive but it did not output any index info, and it wouldn't link up the the [s$] with the same name. Could you be more specific with your end goal?
-
I have bypassed some of your work, but left it in place in case you need it... that makes a mess I know.
Here is a completely working (in windows...hopefully in OSX) cabinet. I will try to tidy it, or you can if it works for you.
Any symbol sent will be saved in a drawer. Drawers are only created when a symbol is saved, and they are created with the number (from the slider).
When you select the same number they can be re-written, ... updated, written over.
The "receive" fader reads the contents of the drawers.It is not a list that is "searched", but abstractions that are searched (by index at the moment), and could contain more than one symbol if desired.
The control "s$-help_new" is your main patch as before.
To see the contents of the drawers open [s$_new] from within the patch and click [pd cabinet] at the bottom.
better.zipI will reread your posts to try to understand whether I am helping you or not.
-
@rjpg i've been trying to use qlist to read in floating points from a .txt file. The txt file looks like this:
variablename1 4.0;
variablename2 3.2;
variablename3 659.0;
etc.....in order to read in any of these values, qlist requires me to make an object like [r variablename1] and output the value 4.0 from there
which works, for this one abstraction, but if i wish to use multiples of the same abstraction in the same patch, the [r variablename1] objects need to be localized.
My initial thought was, write "$0-variablename1 4.0;" to the .txt file instead of "variablename1 4.0;" however, a [r $0-variablename1] object just flat out don't work.So my other thoughts were
- is there a way to just load in as a symbol "variablename1"?
which appears to require slist and iem_pb but seems unnecessarily complicated
or - can i create an [r symbol] like instance that will allow me to import from qlist the number 4.0 if i pass it the symbol "variablename1"?
- is there a way to just load in as a symbol "variablename1"?
-
@whale-av all of your examples with iem_pbank_scv will load in the first half of the symbol "variablename1" but when it gets to the space it cuts off the floating point i need, "4.0"
-
Got there!
"sr" was the required message for open panel.............Working even better.zip working patch to import your text file.