AnimeSuki Forums

Register Forum Rules FAQ Community Today's Posts Search

Go Back   AnimeSuki Forum > Anime Related Topics > General Anime > Fansub Groups

Notices

Reply
 
Thread Tools
Old 2010-03-17, 09:32   Link #1021
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 39
Okay so it's actually an echo effect and not a syllable that repeats.

You need something completely different for that, the furigana/multi-highlight syntax isn't designed for that.

Last time I needed to do one, I made a copy of the source line, without any repetition of words in, and timed the duplicate of the line to the echo, then I marked the line so it would get a different effect. It's important here to note that the line with the echo timing still needs to have all of the original line's text in, even if it isn't timed in detail, but the text needs to be there for the positioning to work correctly.

I made up some random timings for the echo text here. The rest is mostly based on the examples from the Inline-fx page in the manual.
Code:
Comment: 0,0:00:00.00,0:00:10.00,Default,,0000,0000,0000,karaoke,{\k23}I{\k28}ma {\k101}wa{\k101} {\k23}to{\k38}ke{\k37}na{\k52}i {\k23}wa{\k28}ke {\k120}wo
Comment: 0,0:00:00.00,0:00:10.00,Default,,0000,0000,0000,karaoke,{\k80\-invisible}{\k23\-echo}I{\k28}ma {\k101}wa{\k100\-invisible} {\k23}to{\k38}ke{\k37}na{\k52}i {\k71}{\k23\-echo}wa{\k28}ke {\k120}wo
Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,code syl,fxgroup.blankfx = (syl.inline_fx == "")
Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,code syl,fxgroup.notinvis = (syl.inline_fx ~= "invisible")
Comment: 1,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,template syl fxgroup blankfx noblank,{\pos($x,$y)\shad0\bord2}
Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,template syl fx invisible notext noblank,{invisible syllable skipped: !syl.text_stripped!}
Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,template syl fxgroup notinvis noblank,!retime("syl")!{\pos($x,$y)\shad0\bord10\t(\bord2)}
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2010-03-17, 09:53   Link #1022
jofori89
Member
 
 
Join Date: Feb 2009
Location: Vietnam
Age: 34
Send a message via MSN to jofori89 Send a message via Yahoo to jofori89
Thank you so much. But i dont know \k80 and \k100 what it means
{\k80\-invisible}{\k23\-echo}I{\k28}ma {\k101}wa{\k100\-invisible}
jofori89 is offline   Reply With Quote
Old 2010-03-17, 12:42   Link #1023
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 39
Those are just empty syllables inserted to delay things.
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2010-03-25, 11:09   Link #1024
Maiku2
Junior Member
 
Join Date: Dec 2006
I read through this forum and Aegisub and didn't see anyone having this same problem, I apoligize if I missed it.

I've been banging my head against the wall all morning. I'm trying to do a simple rotation effect, which I've done several times before without any trouble. For some reason today it just won't rotate. I've tried everything I could think of, so I'm here to plead for help.

Code:
{\alpha&Hff&\an5\t($start,$start,\1a&H00&)\t($start,$end,\frz360)\t($end,$end,\alpha&Hff&)}
It appears and disapears like I want, but no rotation. I've tried it without the alpha effects, adding pos and org tags, and using different rotation values. The most I get is the whole line rotates at the beginning. Thank you for reading this.
Maiku2 is offline   Reply With Quote
Old 2010-03-25, 12:21   Link #1025
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 39
Maiku2:
Is that a "line" or a "syl" template? Also, are you doing any retiming?
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2010-03-25, 13:18   Link #1026
Maiku2
Junior Member
 
Join Date: Dec 2006
Thanks for getting right back to me jfs.

It's a template line and I've checked the timing, there's nothing wrong with it that I can find.

Edit: The timing is right, but I'd copied the line above and it was a template line and not a template. I changed it to a template and it turns now. Though it's a bit distorted, not just a rotate like I wanted. I'll have to figure what I did to cause that and figure out where my border went.

Thanks again! I knew it was something stupid I just couldn't think of it.

Last edited by Maiku2; 2010-03-25 at 13:29.
Maiku2 is offline   Reply With Quote
Old 2010-03-25, 13:25   Link #1027
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 39
If you want a syllable to rotate around its own centre you must use a "syl" template. If you use a line template as you do now, the centre of rotation for everything on the line will be the origin point of the line, i.e. the middle of the line, which makes for a rather strange effect for the rotation, probably not what you want.
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2010-04-08, 22:30   Link #1028
jofori89
Member
 
 
Join Date: Feb 2009
Location: Vietnam
Age: 34
Send a message via MSN to jofori89 Send a message via Yahoo to jofori89
How can i repeat \t() syl.n times or 10 times for once lines, increase in startadjust & endadjust
Some thing like this
time = line.duration/syl.n
{\frz0\t(0, !1*time!, \frz-5)\t(!1*time!, !2*time!,\frz0)\\t(!3*time!, !3*time!,\frz-5)...}

I mean i want to join all lines (10 lines or more) of the loop to only once line.

Code:
code line: rotz = -math.random(1,4)*0.1
template syl loop 10: !retime("preline", (j-1)*(line.duration/10), j*(line.duration/10))!{\k$skdur}{\frz!((j%2)*2-1) == -1 and rotz or -rotz!\fry!((j%2)*2-1) == -1 and rotz*3+10 or -rotz*3+10!\t(\frz!((j%2)*2-1) == 1 and rotz or -rotz!\fry!((j%2)*2-1) == 1 and rotz*3+10 or -rotz*3+10!)\pos($scenter, $smiddle)}

Comment: 0,0:00:17.16,0:00:24.16,Default,,0000,0000,0000,karaoke,{\k45}Tell {\k42}me {\k31}na{\k39}ni{\k43}mo {\k20}wa{\k27}ka{\k16}ra{\k32}na{\k40}i {\k152}no {\k25}de{\k188}mo
Here is video, (swinging texts)
http://www.youtube.com/watch?v=4HTWx263opY&fmt=18

Last edited by jofori89; 2010-04-08 at 22:40.
jofori89 is offline   Reply With Quote
Old 2010-04-09, 16:20   Link #1029
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 39
You need to create a helper function in a code line to do that, that's the only way you can use a "for" loop directly, which is what you need to.
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2010-04-09, 22:31   Link #1030
jofori89
Member
 
 
Join Date: Feb 2009
Location: Vietnam
Age: 34
Send a message via MSN to jofori89 Send a message via Yahoo to jofori89
Quote:
Originally Posted by jfs View Post
You need to create a helper function in a code line to do that, that's the only way you can use a "for" loop directly, which is what you need to.
I tried this fucntion, it does not work but i dont know how to fix it, what's wrong with the loop?

Code:
code line: rotz = -math.random(1,4)*0.1; wind_offset = line.duration/(line.kara.n); function turn() for r=1,line.kara.n do turn = turn .. string.format("\\t(%d,%d,\\frz%d\\fry%d)",wind_offset*(r-1),wind_offset*r,rotz,rotz*3+10) if rotz < 0 then rotz=0 else rotz=-math.random(1,3)*3 end end return turn end; wind = "{"..turn.."}"

template syl: {\an5\pos($scenter, $smiddle)}!wind!
Error
Quote:
Runtime error in template code: [string "template code"]:1: attempt to concatenate global 'turn' (a function value)
Code producing error: rotz = -math.random(1,4)*0.1; wind_offset = line.duration/(line.kara.n); function turn() for r=1,line.kara.n do turn = turn .. string.format("\\t(%d,%d,\\frz%d\\fry%d)",wind_off set*(r-1),wind_offset*r,rotz,rotz*3+10) if rotz < 0 then rotz=0 else rotz=-math.random(1,3)*3 end end return turn end; wind = "{"..turn.."}"
jofori89 is offline   Reply With Quote
Old 2010-04-10, 02:22   Link #1031
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 39
You're forgetting to put function call parentheses onto the function name, so you're concatenating a function with a string, instead of concatenating the result of calling the function.

template syl: {\an5\pos($scenter, $smiddle)}{!turn()!}
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2010-04-10, 04:29   Link #1032
jofori89
Member
 
 
Join Date: Feb 2009
Location: Vietnam
Age: 34
Send a message via MSN to jofori89 Send a message via Yahoo to jofori89
Quote:
Originally Posted by jfs View Post
You're forgetting to put function call parentheses onto the function name, so you're concatenating a function with a string, instead of concatenating the result of calling the function.

template syl: {\an5\pos($scenter, $smiddle)}{!turn()!}
Code:
code line: rotz = -math.random(1,4)*0.1; wind_offset = line.duration/(line.kara.n);
function turn() for r=1,line.kara.n do turn = turn .. string.format("\\t(%d,%d,\\frz%d\\fry%d)",wind_offset*(r-1),wind_offset*r,rotz,rotz*3+10) if rotz < 0 then rotz = 0 else rotz = -math.random(1,3)*3 end end return turn() end; turn = "{"..turn.."}"

template syl: {\an5\pos($scenter, $smiddle)}{!turn()!}
It's still not working, i think is has some error in do and return?
jofori89 is offline   Reply With Quote
Old 2010-04-10, 14:32   Link #1033
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 39
Oh, I didn't notice you were abusing the function name that much.
Actually you probably won't need a callable function at all and can just do it directly in a code line... of course that will need to be a "code syl" line if you want it to update for every syllable.

Note that you're using the same name, "turn", for two different things. You're using it as the name of the function, but you're also using it for the name of the value the function calculates. Because the function is the first thing defined, it's the first thing that goes into the global variable by the name "turn" (in Lua, functions don't really have a name, their names are just variables that point to the function code) and after the function name has become valid, you start trying to treat the function value as a string.
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2010-04-11, 05:15   Link #1034
jofori89
Member
 
 
Join Date: Feb 2009
Location: Vietnam
Age: 34
Send a message via MSN to jofori89 Send a message via Yahoo to jofori89
Quote:
Originally Posted by jfs View Post
Oh, I didn't notice you were abusing the function name that much.
Actually you probably won't need a callable function at...
Can you give me a example? I don't really get whats you say

Quote:
Note that you're using the same name, "turn", for two different things
I dont sure about the return command

function turn() for r=1,line.kara.n do b_turn = turn .. string.format("\\t(%d,%d,\\frz%d\\fry%d)",wind_off set*(r-1),wind_offset*r,rotz,rotz*3+10) if rotz < 0 then rotz = 0 else rotz = -math.random(1,3)*3 end end return b_turn end;
jofori89 is offline   Reply With Quote
Old 2010-04-11, 17:40   Link #1035
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 39
Code:
code syl: turntags = ""; for T = 1, line.kara.n do turntags = turntags .. string.format("\\t(%d,%d,\\frz%d\\fry%d)", wind_offset*(T-1), wind_offset*T, rotz, rotz*3+10); rotz = math.max(0, -math.random(1, 3)*3); end
template syl: {\an5\pos($scenter, $smiddle)}{!turntags!}
The code neatly formatted:
Code:
turntags = ""
for T = 1, line.kara.n do
    turntags = turntags .. string.format(
        "\\t(%d,%d,\\frz%d\\fry%d)",
        wind_offset*(T-1), wind_offset*T,
        rotz, rotz*3+10)
    rotz = math.max(0, -math.random(1, 3)*3)
end
The code will simply run once per syllable, before the template is processed, and build the "turntags" variable (resetting it to blank first). The value of that variable is then included in the template text.
Though, I'm not sure why the number of syllables in the line should determine how much the shaking/rotating is done, and why the timings of the syllables isn't used either when you're essentially doing the same thing for each syllable.
Another thing, this will obviously make each syllable get a different sequence of rotations, since the "turntags" is calculated once for every syllable, but you can easily change that to be once per line instead.
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2010-04-11, 19:08   Link #1036
jofori89
Member
 
 
Join Date: Feb 2009
Location: Vietnam
Age: 34
Send a message via MSN to jofori89 Send a message via Yahoo to jofori89
Quote:
Originally Posted by jfs View Post
Though, I'm not sure why the number of syllables in the line should determine how much the shaking/rotating is done, and why the timings of the syllables isn't used either when you're essentially doing the same thing for each syllable.
Another thing, this will obviously make each syllable get a different sequence of rotations, since the "turntags" is calculated once for every syllable, but you can easily change that to be once per line instead.
When I use code syl and wind_offset = syl.duration, the rotation of all characters are not synchronic, so I must to change to code line, wind_offset = line.duration/line.kara.n

Thanks you so much, this code'll help me for a lot of other karaoke FX
jofori89 is offline   Reply With Quote
Old 2010-05-04, 17:44   Link #1037
davide wilson
Junior Member
 
Join Date: Mar 2010
help

hello jfs can you explain mathrandom and to take me a sample exemple please
and thanks
davide wilson is offline   Reply With Quote
Old 2010-05-04, 19:36   Link #1038
jofori89
Member
 
 
Join Date: Feb 2009
Location: Vietnam
Age: 34
Send a message via MSN to jofori89 Send a message via Yahoo to jofori89
Quote:
Originally Posted by davide wilson View Post
hello jfs can you explain mathrandom and to take me a sample exemple please
and thanks
Math.random(a, b) or maht.random(b)
Random is random taking a number/string from a to b or 0 to b

5.6 - Mathematical Functions

This library is an interface to the standard C math library. It provides all its functions inside the table math.

math.abs (x)

Returns the absolute value of x.

math.acos (x)

Returns the arc cosine of x (in radians).

math.asin (x)

Returns the arc sine of x (in radians).

math.atan (x)

Returns the arc tangent of x (in radians).

math.atan2 (y, x)

Returns the arc tangent of y/x (in radians), but uses the signs of both parameters to find the quadrant of the result. (It also handles correctly the case of x being zero.)

math.ceil (x)

Returns the smallest integer larger than or equal to x.

math.cos (x)

Returns the cosine of x (assumed to be in radians).

math.cosh (x)

Returns the hyperbolic cosine of x.

math.deg (x)

Returns the angle x (given in radians) in degrees.

math.exp (x)

Returns the value ex.

math.floor (x)

Returns the largest integer smaller than or equal to x.

math.fmod (x, y)

Returns the remainder of the division of x by y that rounds the quotient towards zero.

math.frexp (x)

Returns m and e such that x = m2e, e is an integer and the absolute value of m is in the range [0.5, 1) (or zero when x is zero).

math.huge

The value HUGE_VAL, a value larger than or equal to any other numerical value.

math.ldexp (m, e)

Returns m2e (e should be an integer).

math.log (x)

Returns the natural logarithm of x.

math.log10 (x)

Returns the base-10 logarithm of x.

math.max (x, ···)

Returns the maximum value among its arguments.

math.min (x, ···)

Returns the minimum value among its arguments.

math.modf (x)

Returns two numbers, the integral part of x and the fractional part of x.

math.pi

The value of pi.

math.pow (x, y)

Returns xy. (You can also use the expression x^y to compute this value.)

math.rad (x)

Returns the angle x (given in degrees) in radians.

math.random ([m [, n]])

This function is an interface to the simple pseudo-random generator function rand provided by ANSI C. (No guarantees can be given for its statistical properties.)

When called without arguments, returns a uniform pseudo-random real number in the range [0,1). When called with an integer number m, math.random returns a uniform pseudo-random integer in the range [1, m]. When called with two integer numbers m and n, math.random returns a uniform pseudo-random integer in the range [m, n].

math.randomseed (x)

Sets x as the "seed" for the pseudo-random generator: equal seeds produce equal sequences of numbers.

math.sin (x)

Returns the sine of x (assumed to be in radians).

math.sinh (x)

Returns the hyperbolic sine of x.

math.sqrt (x)

Returns the square root of x. (You can also use the expression x^0.5 to compute this value.)

math.tan (x)

Returns the tangent of x (assumed to be in radians).

math.tanh (x)

Returns the hyperbolic tangent of x.
jofori89 is offline   Reply With Quote
Old 2010-05-05, 04:37   Link #1039
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 39
Quote:
Originally Posted by jofori89 View Post
Random is random taking a number/string from a to b or 0 to b
It doesn't work on strings, only numbers.
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2010-05-05, 07:27   Link #1040
jofori89
Member
 
 
Join Date: Feb 2009
Location: Vietnam
Age: 34
Send a message via MSN to jofori89 Send a message via Yahoo to jofori89
Exclamation

Quote:
Originally Posted by jfs View Post
It doesn't work on strings, only numbers.
Sorry i wrong, I dont know how to call this.

Code:
code once: code_a = {"a", "b", "c"}
!code_a[math.random(3)]!
And i have a other question, how to set fx group for some syllables in once line, something like this,

Code:
fxgroup.ginkgo = (line.actor == "ginkgo" and syl.i == 1); fxgroup.ginkgo = (line.actor == "ginkgo" and syl.i == 5); fxgroup.ginkgo = (line.actor == "ginkgo" and syl.i == 9);
jofori89 is offline   Reply With Quote
Reply

Tags
fansubbing, karaoke, software


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 21:41.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
We use Silk.