pt_SSA Karaoke Animator

Moderator: Paul Tuersley

Post Reply
ifrittt
Posts: 18
Joined: April 30th, 2006, 1:02 pm

How I can make a karaoke effect with expressions like .position.wiggle(7,50)
with that script?
Glove
Posts: 6
Joined: March 24th, 2007, 10:05 am

Hi there !

Thank you for this script, it's amazing !

But how could you manage vertical karaokes ?
Like karaokes written in japanese or other vertical languages ?

I mean for example like that :






Instead of like that : あいうえお

I tried adding a "new line" char at the end of each word in the script, but I don't know what it is...
I tried :

Code: Select all

973: finalText += "\n";
And :

Code: Select all

971: r="";
972: for(i=0;i<textArray.length;i++) {
973:     r+="\n";
974: }
975: currentWord =+ n;
But it didn't work.

Is it possible what I'd like to do ?
Is there a property to say Text.alignement = vertical, or equivalent ?

Thanks by advance for your answer !


PS : Sorry for my english... I'm not english :cry:
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Although AE has a Vertical Text Tool and an option to convert horizontal text to vertical, I can't see a way of accessing these options with a script.

My old SSA Subtitle Importer script will work with vertical text (you need to create a vertical text layer first and have it selected when running the script) but the SSA Karaoke Animator script doesn't work in the same way.

However, try inserting the middle bit of this code into the SSA Karaoke Animator v1.1 script at around line 982. It seems to do what you want.

Code: Select all

		// proceed if any text was found
		if (finalText != "") 
		{
			currentWord = "";
			
			
			// this section adds a line return after each character to make vertical text
			var tempText = "";		
			for (var z = 0; z < finalText.length; z++)
			{
				tempText += finalText.charAt(z) + "\r";
			}
			finalText = tempText;
			 
		
			// loop through each word/syllable....
Glove
Posts: 6
Joined: March 24th, 2007, 10:05 am

Woaw, thanks a lot for your speed and efficiency !

It works exactly as I wanted, thanks again !!!

I added a checkbox to control if it imports in vertical mode or not.
It seems to work, here are the modifications I made :

Code: Select all

----[ FIND ]---
// fixed duration text and checkbox
			pal.animPnl.fixedDurationText = pal.animPnl.add("statictext", [10,120,pal.animPnl.startText.bounds.left-5,135], "Fixed Duration:");
			pal.animPnl.fixedDurationCheckBox = pal.animPnl.add("checkbox", [pal.animPnl.startText.bounds.left, 120, pal.animPnl.startText.bounds.left +20, 135], "");
			pal.animPnl.fixedDurationCheckBox.onClick = onFixedDurationCheckBoxClick;

			pal.animPnl.durationText = pal.animPnl.add("edittext", [pal.animPnl.fixedDurationCheckBox.bounds.right+5,118,pal.animPnl.fixedDurationCheckBox.bounds.right+40,135], "0.5");
			pal.animPnl.secondsText = pal.animPnl.add("statictext", [pal.animPnl.durationText.bounds.right+5,120,pal.animPnl.durationText.bounds.right+200,135], "seconds from Start to End");
			pal.animPnl.durationText.visible = false;
			pal.animPnl.secondsText.visible = false;
			pal.animPnl.durationText.onChange = onDurationTextChange;

---[ AFTER, ADD ]---
// Vertical Text ?
			pal.animPnl.verticalText = pal.animPnl.add("statictext", [200,95,pal.animPnl.startText.bounds.left-5+200,110], "Vertical Text ?");
			pal.animPnl.verticalCheckBox = pal.animPnl.add("checkbox", [pal.animPnl.startText.bounds.left+190, 95, pal.animPnl.startText.bounds.left +210, 110], "");

Code: Select all

---[ FIND ]---
// if this is the trails preset
				else if (presetArray[presetIndex][presetProps][0] == "Trails")
				{
					if (presetArray[presetIndex][presetProps][1] == 1)
						palette.animPnl.trailsCheckBox.value = true;
					else
						palette.animPnl.trailsCheckBox.value = false;
				}

---[ AFTER, ADD ]---
// if this is the vertical text preset
				else if (presetArray[presetIndex][presetProps][0] == "Vertical")
				{
					if (presetArray[presetIndex][presetProps][1] == 1)
						palette.animPnl.verticalCheckBox.value = true;
					else
						palette.animPnl.verticalCheckBox.value = false;
				}

Code: Select all

---[ FIND ]---
// add the trails section to the preset
		tempString = '["Trails",';
		if (palette.animPnl.trailsCheckBox.value == true)
			tempString += '1],';
		else
			tempString += '0],';
		
		presetString[presetString.length] = tempString;

---[ AFTER, ADD ]---
// add the vertical section to the preset
		tempString = '["Vertical",';
		if (palette.animPnl.verticalCheckBox.value == true)
			tempString += '1],';
		else
			tempString += '0],';
		
		presetString[presetString.length] = tempString;

Code: Select all

---[ FIND ]---
// proceed if any text was found
		if (finalText != "") 
		{
			currentWord = "";

--[ AFTER, ADD ]---
// this section adds a line return after each character to make vertical text if vertical text is required
			if (palette.animPnl.verticalCheckBox.value == true)
			{
				var tempText = "";
				for (var z = 0; z < finalText.length ; z++)
				{
					tempText += finalText.charAt(z) + "\r";
				}
				finalText = tempText;
			}
ifrittt
Posts: 18
Joined: April 30th, 2006, 1:02 pm

I was seeing that in your v2 script the effects dont affect the whole sylabbe, it only places the effect you did in the first frame effect. Can you change that to like the v1 script?

Thanks
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Can you post me a zipped archive of your project, along with the .ssa file and animation preset you used to paul.tuersley@btinternet.com

I'm not sure what you're seeing. I'm guessing maybe it's a problem with the animation preset you created. Have you tried with that preset I sent you a few weeks ago? Does that sufffer from the same problem?
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Ok, well the files you sent work as I'd expect them to. So are you asking why the blur effect happens 1 frame late. i.e. 1 frame after the layer marker?

This is because the v2 script currently applies an Animation Preset on the first frame of a syllable, but often the first keyframe in a preset will be the Before keyframe, which the v1 script placed on the frame before the start frame.

I can't know whether a preset needs to be applied on the start frame or the one before, so we need some UI to allow you to specify the frame offset. This is one of the reasons v2b1 is a beta. It's just to give you a chance to play with that functionality and give me some feedback.

Does that answer your question?
ifrittt
Posts: 18
Joined: April 30th, 2006, 1:02 pm

No >< In that .ssa archive i sent you... "Tsukiakari no shita de" when you use your v2 script for do an effect, that effect doesn't affect the syllabe "ta" complete.
If you do the an effect in your v1 script and compare with an effect did in your v2 script you will understand seeing the keyframes of the sylabe "ta".
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Aha, I think I understand now. This is because an Animation Preset already contains the timings for the keyframes. It's the equivalent of always using "Fixed Duration" in the v1 script, but with the duration already fixed inside the preset.

It is something I've considered. In order to solve it I'd have to apply the preset, figure out when the start and end keyframes were and then stretch all the keyframes to fit the syllable's timings.
arnufle
Posts: 20
Joined: October 18th, 2006, 12:08 pm

the best -->
1- create an animation and save it
2- launch the v1 with a slidercontrol to see the keyframes
3- apply animation for each syllable
4- modify animation's keyframes / slidercontrol's keyframes
5- enjoy :lol:

v1 is better than v2 for me :)
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Here's a new version of the script, SSA_Karaoke_Animator_v2 beta2. I think it's feature complete, but it'd be good if some of you can try to break it before I make it a final release.
(link removed, download from link on first post)

New in this version:
1. The UI is back and now you get to choose whether to use the built-in animator or After Effects presets.
2. You can specify whether the lines of text will fade in or out.
3. There's an option for vertical text.
4. When using After Effects presets, enabling Fixed Duration means the timings in the preset will be preserved. Turn off Fixed Duration and it will factor each syllable's duration into the timings.
5. Regardless of the Fixed Duration setting, you can also use Time Offset and Scale Factor to refine your results. Time Offset lets you move the start time for the keyframes, while Scale Factor stretches the keyframes.
6. The script scans a folder next to the script called SSA_Karaoke_Presets for After Effects animation presets. Save your own presets into that folder, then choose Refresh List from the preset pulldown to see them.

ifrittt,
This should solve the problem where v2b1 didn't change the animation based on the syllable durations. In v2b2 you would select "Animate Using: After Effects Presets", leave Fixed Duration off and, if necessary, play with the Scale Factor value.

Have fun!!
arnufle
Posts: 20
Joined: October 18th, 2006, 12:08 pm

:oops: my dream !!! you're a god !!! this script is perfect !!! no pb, nobug !!! now i can delete v1 thx a lot paul :P
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Glad you like it.

I forgot to mention, if you have any of your own v1.1 presets, they're saved in a text file beside the old script called "SSA_Karaoke_Presets.txt". If you copy that file into the same folder as the new script (not the presets folder inside it) and run the script again, they should appear in the built-in animator preset menu. If you save any new built-in animator presets, that preset file will no longer be compatible with the v1.1 script.

I also forgot about the two other new features in the old style built-in animator. I've added a second Slider Control property and a 4th setting for all properties.
arnufle
Posts: 20
Joined: October 18th, 2006, 12:08 pm

i've a little pb with a animation
http://rapidshare.com/files/24122256/lol.ffx.html
i can't run your script with this preset i don't understand because it's work on a text layer :P
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Try this version:
(link removed, download from link on first post)
Post Reply