Skip to content

Perform small math operations in Mercury? #93

@tmhglnd

Description

@tmhglnd

When creating lists it could be useful to just use some simple math to calculate the length that needs to be used instead of having to calculate this on your own. For example when using functions like every or cosine

current situation

list rtm rotate(every(euclid(11 5) 4 12) 36)
list len cosine(96 1 50 500)

new synth sine note(0 2) shape(1 len) play(rtm) time(1/12)

new situation could look something like:

list rtm rotate(every(euclid(11 5) 4*12) 3*12)
list len cosine(8*12 1 50 500)

new synth sine note(0 2) shape(1 len) play(rtm) time(1/12)

Or maybe possible to create a short alias with the already present list functions

list rtm rotate(every(euclid(11 5) *(4 12)) *(3 12))
list len cosine(*(8 12) 1 50 500)

new synth sine note(0 2) shape(1 len) play(rtm) time(1/12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions