Skip to main content
anthonyv6045270
Participant
March 14, 2022
Question

Character Offset to Randomize Specific Pairs of Letters

  • March 14, 2022
  • 2 replies
  • 407 views

I'd like the bottom left text to do the same as the top right, but the randomized text should be limited to "ATCG" in pairs (e.g. "AATTCCGG), instead of numbers. Is there a way to do this with expressions? Preserve Case &  Digits seems to keep the random text to pairs, but I'm not sure how to make an expression so that the pairs are limited to As, Ts, Cs, and Gs. Thansk!

 

This topic has been closed for replies.

2 replies

Mathias Moehl
Community Expert
Community Expert
March 17, 2022

If you own iExpressions, you can use the Random Letter Wipe iExpression, which contains a customizable alphabet.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mylenium
Legend
March 15, 2022

You have to create a source text expression that's pulling these characters e.g. from an array. Not sure why you would want double letters, though. DNA base pairs are always specific and the same base type can't pair. Your second callout would merely be a random arrangement of ATs and GCs. anyway, here's something you might use:

 

mPairs=[AC,GT,AC,AC,GT];

mChange=3;

mSeed=Math.floor(time/framesToTime(mChange));

 

seedRandom(index+mSeed)

mIndex=Math.round(random(0,mPairs.length);

 

mPairs[mIndex]

 

Modify as you need like tying it to a slider or such...

 

Mylenium