Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Generates dynamic envelopes with N positive integer points

License

NotificationsYou must be signed in to change notification settings

leonyuhanov/EnvelopeGenerator

Repository files navigation

Generates dynamic envelopes with N positive integer points

  • void initEnvelope(unsigned short int* points, unsigned short int* ticks, byte numberOfPoints)

    • Dynamic envelope generator
    • Pass "numberOfPoints" number of elemnts via the array of "unsigned short int points"
    • Pass "numberOfPoints" number of durationsPerPoint via the array of "unsigned short int ticks"
    • "points" an array of Envelope points, the output will wrap around from the last point to the 1st automaticly
    • "ticks" an array of time ticks PER point. This essentialy gives you a way to scale each point and the speed/gradient of the curve
    envelopeGenerator envelopeOne;const byte numberOfPoints =4;unsignedshortint points[numberOfPoints] = {0,10,20,5};unsignedshortint ticks[numberOfPoints] = {30,30,30,30};envelopeOne.initEnvelope(points, ticks, numberOfPoints,0);
  • unsigned short int getEnvelope(unsigned short int frameCounter)

    • Generates your curve based on your point list and time blocks using "frameCounter" (internal variable) as the time index
    • "envelopeOne.envelopeBandwidth" can be used to limit your frame counter and keep it in bounds of your dynamic frame ticks
    while(true){ Serial.printf("\r\n%d", envelopeOne.getEnvelope(envelopeOne.frameCounter)); envelopeOne.nextFrame(1);}

    The above generates this:

OneShot Envelopes

Set up

  envelopeGenerator envelopeOne;const byte numberOfPoints =2;unsignedshortint points[numberOfPoints] = {0,10};unsignedshortint ticks[numberOfPoints] = {30,30};  envelopeOne.initEnvelope(points, ticks, numberOfPoints,1);while(true)  {   Serial.printf("\r\n%d", envelopeOne.getEnvelope());delay(100);  }

About

Generates dynamic envelopes with N positive integer points

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp