Array string extraction / String Switch

A place for developers to share ideas and assist each other in solving problems.

Moderators: valis, garyb

User avatar
faxinadu
Posts: 1621
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Array string extraction / String Switch

Post by faxinadu »

Looking for a way to manipulate some data. i can start with either an array or a collection of strings and what i want to do is end up with one string out of the choices presented in the array or collection of sources.

So, either an ability to be able to extract strings from an array based on index location or a switch that can handle strings.

any ideas?
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
w_ellis
Posts: 554
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: Array string extraction / String Switch

Post by w_ellis »

I never had too much fun working with Strings or Arrays, but I think that was due to my limited C++ skills. There was a discussion here that could start pointing in the right direction, but I never had time to follow up on it. http://bcmodular.co.uk/forum/viewtopic. ... rray#p1130

I'm hoping that with SDK v7 the tools for building DLLs etc will get a bit of love!
User avatar
faxinadu
Posts: 1621
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: Array string extraction / String Switch

Post by faxinadu »

indeed quite annoying :0

another somewhat related question - any ideas how to add two strings (ammend a string)?

for example take "hello" from one module and add "world" from another to form "hello world"

been looking a bit at the pep files but no hint so far.
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
w_ellis
Posts: 554
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: Array string extraction / String Switch

Post by w_ellis »

Again, with a C++ DLL would be super easy, but I'm not exactly sure how you'd go about it using the raw modules in SDK. You might have to do some clever stuff with bit shifting, or conversions back and forth from arrays, but I can't see any obvious PEP or DSP modules that would help.

Perhaps Roy would have an idea, as I know he played with String stuff in the past. tgstgs would also know, but I've not seen him around for a long time.
User avatar
faxinadu
Posts: 1621
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: Array string extraction / String Switch

Post by faxinadu »

yah just to program it is very simple. hmmm ok back to thinking :)
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
w_ellis
Posts: 554
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: Array string extraction / String Switch

Post by w_ellis »

If I ever get any time (two very young kids and a busy job!) then I'll try to get the code that DragonSF suggested working in a DLL... perhaps that will help.

Have you invested any time in building DLL modules for Scope?
User avatar
RA
Posts: 358
Joined: Fri Aug 18, 2006 4:00 pm
Contact:

Re: Array string extraction / String Switch

Post by RA »

It is possible to sent the text value of an array to one of the text fields. One of them has text as a pad/var....
use two of them next to each other sending out HELLO world would do the trick.

Is this what you meant?
dNa Text Switcher.zip
(16.77 KiB) Downloaded 476 times
- We're freaks about gearz and methods -
More on dNa: http://dnamusic.nl
User avatar
faxinadu
Posts: 1621
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: Array string extraction / String Switch

Post by faxinadu »

kinda, but the thing is you used two yeah? one for each value.... actually for one of the things i wanted to do this might work thanks :)
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
User avatar
RA
Posts: 358
Joined: Fri Aug 18, 2006 4:00 pm
Contact:

Re: Array string extraction / String Switch

Post by RA »

Yep. Let me know if you need it open. Those arrays can be powerfull. Yes it is two, but they dont take up any dsp so you can easily use them for this kind of stuff

Cheers nate
- We're freaks about gearz and methods -
More on dNa: http://dnamusic.nl
User avatar
faxinadu
Posts: 1621
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: Array string extraction / String Switch

Post by faxinadu »

yes thanks a bunch, i would love to have a look!
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
User avatar
sharc
Posts: 638
Joined: Mon Oct 29, 2001 4:00 pm
Location: No idea. All looks the same down here

Re: Array string extraction / String Switch

Post by sharc »

1 - The TableTextFader.mdl from the SDK Circuit Design\Circuit Controls folder will work

2 - The Script Adder.mdl from the SDK Circuit Design\Logical\Math Operators folder does what it says on the tin
User avatar
sharc
Posts: 638
Joined: Mon Oct 29, 2001 4:00 pm
Location: No idea. All looks the same down here

Re: Array string extraction / String Switch

Post by sharc »

With the Script Adder module you might want to set 'Type' to 'String', delete the panel and save a new String Adder module...
String Adder.zip
(2.94 KiB) Downloaded 562 times
User avatar
faxinadu
Posts: 1621
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: Array string extraction / String Switch

Post by faxinadu »

sharc wrote:With the Script Adder module you might want to set 'Type' to 'String', delete the panel and save a new String Adder module...
String Adder.zip
doh!! :D nice <3
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
User avatar
sharc
Posts: 638
Joined: Mon Oct 29, 2001 4:00 pm
Location: No idea. All looks the same down here

Re: Array string extraction / String Switch

Post by sharc »

Here's a Hex Array module I built a while back for using with the TableText fader in circuit view. I've created pads for the arrays in case you want to connect other arrays.
Hex Array.zip
(3.51 KiB) Downloaded 528 times
If you want to switch between string arrays you can either use presets or a Routing Recorder.mdl
User avatar
faxinadu
Posts: 1621
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: Array string extraction / String Switch

Post by faxinadu »

you just made a device possible! thank you so much :)
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
JoPo
Posts: 2306
Joined: Wed Jun 05, 2002 4:00 pm
Location: VRRAAaaooOôOooommmh
Contact:

Re: Array string extraction / String Switch

Post by JoPo »

Shark ! I thought you went on another world !

Glad to see you still there ! :)
> > > > > > > > > > > > --- Musica --> here ! ---< < < < < < < < < < < <
User avatar
faxinadu
Posts: 1621
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: Array string extraction / String Switch

Post by faxinadu »

oh now i see this is actually not what i wanted to do. this array module lets me look inside THIS array, but what if i have another module that has an array inside and does not have selvalue output separated from the array parameter. so i would need to take the entire array (count and value) and strip the count away to retain the value if that makes sense.
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
User avatar
sharc
Posts: 638
Joined: Mon Oct 29, 2001 4:00 pm
Location: No idea. All looks the same down here

Re: Array string extraction / String Switch

Post by sharc »

You can copy the contents of an array from one module to another by connecting the array pads.

Here's an example of switching between two external string arrays via a button. You'll need to move the slider to see the result.
Array Switch Example.zip
(13.2 KiB) Downloaded 546 times
User avatar
faxinadu
Posts: 1621
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: Array string extraction / String Switch

Post by faxinadu »

yes i know you can do that and have been trying but this module i'm using gives me incompatible pads message
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
DragonSF
Posts: 405
Joined: Sun Nov 08, 2015 4:28 pm

Re: Array string extraction / String Switch

Post by DragonSF »

Please define what module do you need (inputs, operation and outputs) and I'll create a dll for you:
Example:

Module=<name of the module>
AInput=<para name short>,<para name long>,<type>,<length>;<next para>;
AOutput=<para name short>,<para name long>,<type>,<length>;

type can be one of:
int =>"{ DTYPE_INT, FRAC_MIN, FRAC_MAX },"
frac=>"{ DTYPE_INT, FRAC_MIN, FRAC_MAX },"
midi=>"{ DTYPE_MIDI, 0, 0xFFFFFFFF },"
str=>"{ DTYPE_STRING, 0, 0xFFFFFFFF },"
midi array=>"{ DTYPE_MIDI, 0, 0xFFFFFFFF,xxx },"
int array=>"{ DTYPE_INT,FRAC_MIN, FRAC_MAX,xxx },"
string array=>"{ DTYPE_STRING,FRAC_MIN, FRAC_MAX,xxx },"

To concatenate 2 strings:
Module=AddString
AInput=Str1,,str,;Str2,,str,;
AOutput=Ostr,,str,;
Post Reply