# Individual fade of two structures

**URL:** <https://discourse.processing.org/t/individual-fade-of-two-structures/18760>\
**Category:** Libraries\
**Created:** [March 18, 2020, 3:33am UTC](https://discourse.processing.org/t/individual-fade-of-two-structures/18760 "2020-03-18T03:33:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![byxx](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@byxx](https://discourse.processing.org/u/byxx)\
**Post date:** [March 18, 2020, 3:33am UTC](https://discourse.processing.org/t/individual-fade-of-two-structures/18760/1 "2020-03-18T03:33:00Z")

</div>

Hi there,

In the project (link below) I would like to add some functionality:

[https://editor.p5js.org/byxx/sketches/pGtCNkcq](https://editor.p5js.org/byxx/sketches/pGtCNkcq)

The green and red structure should be able to be faded in and out individually

Case1: During the red structure is visible, the green structure is faded in and out  
Case2: Vice versa

This all should happen to be synchronized to the beat counts.

My main problem: At the moment it seems to be impossible to keep one structure visible as the other one is animated independently…

I guess there will be some refactoring necessary later on  
But it is not the first step now, as I think it is close to become functional, working with the code here so far.

Thanks for your time and patience

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 28, 2020, 4:44pm UTC](https://discourse.processing.org/t/individual-fade-of-two-structures/18760/2 "2020-03-28T16:44:00Z")

</div>

My advice is to start a new sketch to understand just this problem, apart from the complexity of your bigger project. Use a red circle and a green circle. Ignore the grids and symbols and backgrounds and data.

Notice that you need to be able to manipulate red or green independently. In theory, you could have 2 structures or 100 – you need to loop over the structures you have, choose what it should be doing, and draw it – each independently.
