FORUMS: list search recent posts

NEED GUIDANCE! with expression scripting!

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Daniel Nam
NEED GUIDANCE! with expression scripting!
on Oct 12, 2018 at 8:05:50 am

12788_newenew.mov.zip
if no download video can be found here
https://www.reddit.com/r/AfterEffects/comments/9nibid/need_help_with_script...

I am trying to make the red box to be displayed by all the falling notes hitting the piano but as you can see it only recognizes the top part.



This is the pitch slider graph from the midi file imported (This is the chord data in dots but the values are always the peak values at that time)



This is the expression I used for the shape layer (red rectangle)
transform.position + 21.5*(0,thisComp.layer("midi").effect("ch_0_pitch")("Slider")-60)
the midi note value for the far left piano is 21 to far right piano 108
The position of the rectangle starts at midi note value 60 which is the middle c (one white key to the left from the video preview thumbnail)


Return to posts index

Kalleheikki Kannisto
Re: NEED GUIDANCE! with expression scripting!
on Oct 13, 2018 at 7:39:42 am

It seems to me it would be way easier to use the piano roll of the notes and a small area right above the keyboard to see which notes are being hit. For example, a combination of keylight to pull out the green and blue areas and then a mask or track matte to limit it to a small area above the keyboard. Then you can stretch the result and fill it with red.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Daniel Nam
Re: NEED GUIDANCE! with expression scripting!
on Oct 13, 2018 at 3:44:01 pm

What I am actually trying to replicate is this






when the note hits the piano roll, after effects plays combination of 'particular' effects.
I was demonstrating it with red rectangle just for testing with faster rendering.
Could you elaborate what you mean by 'easier to use the piano roll of the notes and a small area right above the keyboard to see which notes are being hit'
By the way, the background with the green and blue box and piano roll is

this app called synthesia. I just screen recorded the app and imported it into AE.


Return to posts index


Kalleheikki Kannisto
Re: NEED GUIDANCE! with expression scripting!
on Oct 14, 2018 at 10:16:01 am

Ok, in that case it makes even more sense to do it in the fashion I described, as you can then use the result in Particular as a layer emitter. I'll put a dummy project together for you, that's easier than a long-winded explanation.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Kalleheikki Kannisto
Re: NEED GUIDANCE! with expression scripting!
on Oct 14, 2018 at 10:58:18 am
Last Edited By Kalleheikki Kannisto on Oct 14, 2018 at 11:08:53 am

Here's a dummy project using your still image as source. I don't have the latest version of Particular, but this should translate over nonetheless. If you don't have Optical Flares, turn that layer off. If you do, that gives you the light glow as the keys are being played. If you get a "missing footage file" in the project, that is the still image of the piano roll you uploaded, just use that.

12803_pianorolldummyproject.aep.zip

Looks like this (shortened version)

12804_pianoroll.mp4.zip

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Daniel Nam
Re: NEED GUIDANCE! with expression scripting!
on Oct 15, 2018 at 5:13:38 am

Wow, at first I did not know what you meant by keylighting but this is a lot simpler than i thought!!
I do not even need to import the midi info.... I spent 5 days trying to figure out LOL
THANK YOU SO MUCH FOR THE DUMMY FILE! YOU ARE MY HERO!

P.S
If I want to use the actual video footage of the still image posted above, can I just import the video file on the project?


Return to posts index


Kalleheikki Kannisto
Re: NEED GUIDANCE! with expression scripting!
on Oct 15, 2018 at 8:26:05 am

Quite likely you don't need Keylight to do this, you can probably use one of the RGB channels in the piano roll footage and get a cleaner black and white output of the notes from it.

I had to animate the still image, so you need to take out the position keyframes after replacing with video. I don't know if it works directly, the still image is not the same resolution nor dimensions as the comp, so you may need to adjust accordingly.

The important thing is to end up with a slice of the piano roll right above the keyboard, white pieces over transparent, that way you can use it as the emitter for both Particular and Optical Flares.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Daniel Nam
Re: NEED GUIDANCE! with expression scripting!
on Oct 16, 2018 at 8:20:27 am

Thanks to your help, I was able to create the video footage.
I have one more question for you.
The prticular particles do not show unless I set the prticles to 100,000+ (Video size is 1920x1080).
Is having that many particles usual? Because it seems to slow down rendering time by a lot.
(I want to layer at least three particular effects but i barely see the particles unless they are all 100,000+)


Return to posts index

Kalleheikki Kannisto
Re: NEED GUIDANCE! with expression scripting!
on Oct 16, 2018 at 9:28:38 am

Yes, that is expected, and is the down side in using a layer emitter. The entire layer is used as an emitter, but particles get their original settings from the layer, so transparent parts produce transparent particles. On that count, if you know the maximum area the particles will be visible in, you can possibly make a solid that only covers that area for your Particular layer. Never actually tried it, but I believe it could work. (The emitter comp dimensions may or may not need to be adjusted to match the dimensions of the Particular solid.)

I would personally render each Particular pass separately and combine the outputs in another comp. That's usually faster than running multiple Particulars at the same time.

---

Now, it would be possible to get a similar end result with a light emitter for every piano key with a pixel-sampling expression to determine whether the key is being pressed or not, but in my experience that is just as slow to render, since you have 64 keys to deal with here, so that would involve 64 pixel sampling expressions running in each frame.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]