rand00 / fry

Functional reactive rhythm library
GNU General Public License v3.0
22 stars 2 forks source link

Make the `ratchet` example print what the source event is #1

Open rand00 opened 1 year ago

rand00 commented 1 year ago

The ratchet example currently prints "ratchet" before each event. The event-streams should instead be extended to bear a string tag that is printed, that specifies if it's a "ratchet" beat or a normal "beat".

This is already done in the ratchet_002 example, which can be used as guide.

AryanGodara commented 1 year ago

Can I work on this @rand00 ?

rand00 commented 1 year ago

Yes thanks (:

AryanGodara commented 1 year ago

Great!! I'll open a PR asap (after writing the code 😅

AryanGodara commented 1 year ago

@rand00 I'm sorry for the delay! I'm still working on this issue. Made some changes locally but it did not seem to work. Will try to go through the code again and figure it out.

Just one doubt, the only difference between ratchet and ratchet_002 examples I see currently is what is printed. So, will printing "ratchet" and "beat" not make the two examples identical? (I'm sorry if this observation is wrong, I might have understood the code wrong 😅 )

rand00 commented 1 year ago

No there is a difference in what operator is called - the examples/ratchet calls every and examples/ratchet_002 calls every' (notice the prime at the end) - it has a more powerful interface where the ratchet amount is limited by a lambda given to it (:

Behind the scenes I'm actually coming up with an even more powerful function for this, as I would like to be able to choose what event is used for the ratchet dynamically. If my changes influence your PR, I'll do the fix needed - just make it work up against the current main branch.

AryanGodara commented 1 year ago

Sorry for the delayed response @rand00 ! (Long classes at the uni this week 😅 ) I understand, I'll check it more carefully this time, and implement the changes asap!

rand00 commented 1 year ago

Note that further work will not count towards the Outreachy application. That said, would love to have you as a contributor out of your own interest (:

AryanGodara commented 1 year ago

Yes yes, Sonja told me about this. But yes, I want to work on this out of interest. It's just that this week is busy in univeresity, so l'll take some time to complete this, but I've not abandoned this issue 😅