FORUMS: list search recent posts

Best way to create an 88-key piano (incl. pressed keys) without many layers / low render time?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Shahid Raza
Best way to create an 88-key piano (incl. pressed keys) without many layers / low render time?
on Jul 2, 2017 at 10:11:50 pm
Last Edited By Shahid Raza on Jul 2, 2017 at 10:31:40 pm

In case anyone missed my last project, here is where I left off with this: https://redd.it/5pdszq

I'm looking at trying to make the piano as efficient as possible with less render time before I move onto other bits for it like the piano roll etc.

Originally I added a piano background to the comp and each individual active key was a separate layer (88 layers). The expressions got really messy.

The idea I have in mind is to only use 12 keys (C, C#, D, D#, E, F, F#, G, G#, A, A#, B) and repeat this in the comp to create the 88 keys. Something like this: http://oi64.tinypic.com/2ekriaf.jpg

But I'd like to be able to activate each individual key of the 88 keys separately and not turn on every F# key for example in the comps.

How would I go about doing this while being able to control each individual key and its active state?

I'll be passing MIDI data to each key, by the way, using the om_midi.jsx script.

Thanks.


Return to posts index

Shahid Raza
Re: Best way to create an 88-key piano (incl. pressed keys) without many layers / low render time?
on Jul 3, 2017 at 7:01:58 pm

To answer my own question, I've a solution through reddit so posting here in case anyone comes across this thread ☺

https://www.reddit.com/r/AfterEffects/comments/6kw2yj/best_way_to_create_an...

Hill0's reply was:

First download true comp duplicator for free. It will make unique comps so that each one can be animated differently.
Then I'd make your 12 key comp and duplicate it as needed. Then make a null layer with 88 checkbox expression controllers. Then it's up to you to link each key to its corresponding checkbox.
Personally I'd pick whip one, then copy that expression and paste it into each key layer. If you increment your layer names by one, you'll only have to change that for each expression.


Return to posts index

Shahid Raza
Re: Best way to create an 88-key piano (incl. pressed keys) without many layers / low render time?
on Jul 5, 2017 at 10:07:14 pm

So I got stuck with the checkbox controls and null objects since I've not done anything like that before and decided to try get a working version at least. Just need a hand in tidying up my expressions now or simplifying the whole structure of the compositions.

Basically, in each octave composition, I have the following layer structure:



The comps are numbered with the C note MIDI value. In this case, it is number 24 with is the first C note on an 88-key piano in MIDI.

The next octave(s) would be 36, 48, 60 (middle C) and so on...

Here's a chart of each key's MIDI value:



The expression below is for the Active C# Left layer's opacity. The Active [piano note name] Right layer version just targets the ch_1_pitch slider which then shows a different colour note press.

Dan kindly helped me out in the last thread where I was struggling with markers for MIDI chords and I've modified the code slightly.

midiNote = comp('Main comp').layer( 'midi' ).effect( 'ch_0_pitch' )( 'Slider' );
thisMidiKey = parseInt(thisComp.name,10)+1;
n = 0;
for (i = 1; i <= midiNote.numKeys; i++){
if (midiNote.key(i).time > time) break;
if (midiNote.key(i).value == thisMidiKey) n++;
}
if (n%2) 100 else 0


For the standard non-active notes (i.e. C# in this case as labelled in the screenshot above), I've added this expression to the opacity:

leftHand = thisComp.layer( 'Active C# Left' ).transform.opacity;
rightHand = thisComp.layer( 'Active C# Right' ).transform.opacity;
if (leftHand == 100 || rightHand == 100 ) 0 else 100


What is happening is if ch_0_pitch slider value is equal to the MIDI key note number per key, it will turn the opacity to 100% otherwise it's at 0%.

The problem is I'm repeating this in every individual layer and I'm sure is has a slow processing time when I have 88 keys, each key note with 3 layers that have expressions running - left hand note, right hand note and the non-active state. That's 264 layers!

I'd like to make the whole structure efficient if possible. If null objects and control layers can do this or anything else, can someone please give me a breakdown on how to achieve it (with expressions if possible?).

Thanks!


Return to posts index


Shahid Raza
Re: Best way to create an 88-key piano (incl. pressed keys) without many layers / low render time?
on Jul 7, 2017 at 9:24:01 pm

Anyone able to help with this?


Return to posts index

Shahid Raza
Re: Best way to create an 88-key piano (incl. pressed keys) without many layers / low render time?
on Jun 27, 2019 at 9:23:43 pm

I know this is probably a very old post bump but I'd like to post an update after 2 years of working on this project!

I tried to automate the whole process in the making, so you can now load in MIDI and MP3 files, the script does the magic (all automated), ready to render and export.

I've been refining the project and have made it available for purchase for anyone who is interested in supporting the work (and further development of this project).

I plan to expand it into something much bigger than just an After Effects project (like a web app or a real time visualisation software).

Check it out at https://www.visipiano.com/ if you are interested!


Return to posts index

Michael Szalapski
Re: Best way to create an 88-key piano (incl. pressed keys) without many layers / low render time?
on Jun 28, 2019 at 4:46:16 pm

That's a really cool project and a great amount of work!

- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')

No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.


Return to posts index


Tomas Bumbulevičius
Re: Best way to create an 88-key piano (incl. pressed keys) without many layers / low render time?
on Jun 30, 2019 at 11:15:41 am

While the project indeed generates a nice outcome, all the 'I''s is a bit of a bragging (to say the least), when it comes to who made this to work as it is, knowing at which point it was initially. Seems like a lesson haven't been learned and you still go in the same path. Pretending you did all the work, without giving a credit to the ones who actually made it to work?

Good luck, Shahid, yet its unfortunate way of doing business and let this thread be your mirror of promoting the tool, just like you wanted it to be. Cheers!

Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer - Dynamic Text Boxes Template with a Live Preview


Return to posts index

Shahid Raza
Re: Best way to create an 88-key piano (incl. pressed keys) without many layers / low render time?
on Jun 30, 2019 at 12:13:06 pm

Hi Tomas,

I've never referred to the work done on VisiPiano as just completely mine. You can see my threads across this forum, on Adobe Forums, Reddit and other multiple sites asking for help and guidance.

While we did business together at one point, you are being a little unfair with your reply to this thread since you decided it was best that you didn't continue working on this project - you wanted transparency and recognition for your part in this project (yet the work was done and paid for on a freelance / white label basis via Upwork at the time, as I hired your company for version 2 and 3). So I have moved forward from our differences just like you have.

The concept and idea was created by myself as well as the graphics and project structure, then given automation functionality by developers. I am still thankful for you giving this project some direction, but Version 4.0 and above has been re-written. VisiPiano is a growing team now. My plan is to make VisiPiano a realtime piano visualisation / sheet music composing software, not just an After Effects project.

I have a new developer involved on this project now and still looking for more people to get involved, as well as a sales team. The system now uses a Java web app to create the right files for import as well as an updated codebase in the script (with new features like multiple tempo detection, and 16 channel MIDI import functionality coming soon). The bugs from 2.0 and 3.0 have been removed.

To get to the point VisiPiano's After Effects project is today, I am grateful for all the help I've got from people like yourself, this forum, Dan Ebberts (as I've mentioned in the past), the help from Adobe Forums, and people like Patrik Pietschmann / Rousseau for inspiring me in the first place.


Return to posts index

Tomas Bumbulevičius
Re: Best way to create an 88-key piano (incl. pressed keys) without many layers / low render time?
on Jun 30, 2019 at 4:13:21 pm

Just a quick breakdown on the topic, before I leave this thread:
1. Every of your sentences starts with 'I' in post above, none mentioned anyone involved. Not only me, but previous and current devs as well. Which, recognised by my previous experience with you, sets a tone.
2. Talking about unfairness of my behaviour here is an interesting thing, when our collaboration ended up by you not following our initial agreement, not to mention lying about the past development and hiding the truth until its revealed in production.
3. There is a bit different thing when it comes to forums help & inspiration, and project rewriting from scratch. Which, in fact, ended XX to XXX times improvement of efficiency.

My point here was the one and the only - you didn't shared a credit in public to whoever developed the tool. In our case specifically, it was one of the main agreements of our collaboration, which wasn't followed.

Wish you all the best in further endeavours. At the same time - following own words is essential to stay true with others. Good luck :)

Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer - Dynamic Text Boxes Template with a Live Preview


Return to posts index

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