SynthMaker

String Reverse helper

Archive · 2011 11 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

billv ·

Reverses a string up to 100 characters long.

trogluddite ·

Here's one that will reverse a string of any arbitrary length...

...less trigger here, so it generally works much faster.

One thing I've noticed with this one and your version - for some reason the string extract struggles with the NewLine character - when i tried them both with a multi-line text box, the line breaks appear, but sometimes also an extra 'black block' character.

billv ·

Awesome-I new there had to be a better way of accounting for every character. Bonus for me: example of the "Loop" module. Havn't used it yet in SM. Cheers

trogluddite ·

billv wrote: Bonus for me: example of the "Loop" module. Havn't used it yet in SM. Cheers

No problem. The Loop can be super handy because all the stuff 'inside' the loop runs much faster than triggers can normally go. NB) Be sure to include that final Sample and Hold connected to the 'Finished' pin of the Loop primitive. That makes sure that the super-fast loop ticks don't 'escape' into the rest of the schematic and cause mayhem!

MyCo ·

trogluddite wrote: One thing I've noticed with this one and your version - for some reason the string extract struggles with the NewLine character - when i tried them both with a multi-line text box, the line breaks appear, but sometimes also an extra 'black block' character.

On Dos/Win systems, a linefeed consists of two bytes (line feed & carriage return), you need them in the right order, or they make problems.

infuzion ·

trogluddite wrote: One thing I've noticed with this one and your version - for some reason the string extract struggles with the NewLine character - when i tried them both with a multi-line text box, the line breaks appear, but sometimes also an extra 'black block' character.

I used to notice that I had to translate things I pasted into SM to a "Mac" text format, eg just CR IIRC.

trogluddite ·

MyCo wrote: two bytes (line feed & carriage return)

infuzion wrote: "Mac" text format, eg just CR IIRC.

Thanks for that info - explains a few other glitches I've had before when manipulating strings.

billv ·

Hey trogluddite, can your osm be modified to handle arrays. Been trying and getting nowhere.. Only way I've found so far is to throw each one into a stack, with a ticker and selecter. It's not pretty, but it works. EDIT: Re-uploaded osm-has another version on it

trogluddite ·

You're nearly there - using the stack is good, you just need to replace the ticker/selector with the Loop primitive.

billv ·

Yeh I've got it going using a loop. It works, but the method still not right. I didn't use the step or finished pins. Nothing worked when i tried to put the sample and hold on.

trogluddite ·

Not using the 'Step' pin is no problem, the 'loop value' pin will reliably trigger the following section. The step pin is just handy when integer is not the right data type, but in this case an integer is just what you need for the Array Get. The other reason to use it sometimes, is that the 'Step' trigger always comes after the count has changed, so sometimes it is useful to make sure that the triggers are flowing in the right order when the stuff 'inside the loop' is particularly complex.

For the 'Finished' pin, you would wire it similar to my previous schematic - using a 'String Array Sample and Hold' right next to the module output.

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.