├── .github └── workflows │ └── main.yml ├── .gitignore ├── LICENSE ├── README.md ├── VL.NodeGen.vl ├── deployment └── VL.NodeGen.nuspec ├── help ├── HowTo Use NodeGen.vl └── csharp │ └── nodegen-help-project │ ├── AnimationHelper.cs │ ├── BoidSimulation.cs │ ├── BreathAnimation.cs │ ├── CaesarCipher.cs │ ├── NuGet.config │ ├── StarShapeGenerator.cs │ └── nodegen-help-project.csproj └── nodegen-screenshot.png /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: push_nuget 2 | 3 | # on push on main 4 | on: 5 | push: 6 | branches: 7 | - main 8 | paths-ignore: 9 | - README.md 10 | workflow_dispatch: 11 | 12 | jobs: 13 | build: 14 | runs-on: windows-latest 15 | steps: 16 | - name: Git Checkout 17 | uses: actions/checkout@master 18 | 19 | - name: Setup Nuget.exe 20 | uses: nuget/setup-nuget@v1 21 | 22 | - name: Publish VL Nuget 23 | uses: vvvv/PublishVLNuget@1.0.29 24 | with: 25 | nuspec: deployment\VL.NodeGen.nuspec 26 | icon-src: https://raw.githubusercontent.com/vvvv/PublicContent/master/nugeticon.png 27 | icon-dst: ./deployment/nugeticon.png 28 | nuget-key: ${{ secrets.NUGET_KEY }} 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | .vs/ 3 | 4 | # .v4p backup files 5 | *~.xml 6 | 7 | # Dynamic plugins .dll 8 | bin/ 9 | 10 | /.vl/ 11 | /lib/ 12 | 13 | ._* -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2024 Dominik Jancik 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | *vvvv talk:* 2 | # https://youtu.be/GCK-EMcYaNg?si=a7LvGxmKTJlCMrY5 3 | 4 | 5 | # VL.NodeGen 6 | 7 | Use AI to effortlessly generate nodes for your vvvv gamma projects 8 | 9 | ![VL.NodeGen help screenshot](nodegen-screenshot.png?raw=true "VL.NodeGen examples") 10 | 11 | 12 | 13 | ## Installation 14 | 15 | - open vvvv gamma 16 | - Quad Menu > Manage Nugets > Commandline 17 | - type `nuget install VL.NodeGen -pre` 18 | -------------------------------------------------------------------------------- /VL.NodeGen.vl: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | Bang 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | Bang 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | Bang 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | Bang 168 | 169 | 170 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | Bang 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 9 752 | Comment 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | -------------------------------------------------------------------------------- /deployment/VL.NodeGen.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | VL.NodeGen 5 | 0.0.5 6 | VL.NodeGen 7 | domj 8 | domj 9 | https://github.com/domjancik/VL.NodeGen 10 | false 11 | Use AI to effortlessly generate nodes for your vvvv gamma projects 12 | Use AI to effortlessly generate nodes for your vvvv gamma projects 13 | nuget 14 | MIT 15 | icon\nugeticon.png 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /help/HowTo Use NodeGen.vl: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | Bang 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 9 61 | Comment 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | true 102 | 1.25 103 | 20 104 | -0.25 105 | true 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | Toggle 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | Toggle 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 9 548 | Comment 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | -------------------------------------------------------------------------------- /help/csharp/nodegen-help-project/AnimationHelper.cs: -------------------------------------------------------------------------------- 1 | // Function prompt: 2 | // Surprise me with some nice animation based on a time parameter 3 | 4 | ///Generated VL (vvvv gamma) Node using ChatGPT April 1, 2023 5 | ///Via the NodeGen Node Set available at: https://github.com/domjancik/VL.NodeGen 6 | ///For more examples, see: 7 | ///https://thegraybook.vvvv.org/reference/extending/writing-nodes.html#examples 8 | 9 | using Stride.Core.Mathematics; 10 | 11 | namespace nodegen_help_project; 12 | 13 | public static class AnimationHelper 14 | { 15 | public static float Oscillate(float time, float frequency, float amplitude) 16 | { 17 | return amplitude * (float)Math.Sin(2 * Math.PI * frequency * time); 18 | } 19 | 20 | public static float Rotate(float time, float speed) 21 | { 22 | return time * speed % 360; 23 | } 24 | 25 | public static Vector2 Spiral(float time, float speed, float expansionRate) 26 | { 27 | float angle = Rotate(time, speed); 28 | float radius = expansionRate * time; 29 | return new Vector2(radius * (float)Math.Cos(angle), radius * (float)Math.Sin(angle)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /help/csharp/nodegen-help-project/BoidSimulation.cs: -------------------------------------------------------------------------------- 1 | // Function prompt: 2 | // simulate boid movement iteratively in using Vector2, use two output arguments for positions and velocities, ensure that you stick to the template. Implement all functions, do not use placeholders. 3 | 4 | using Stride.Core.Mathematics; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | 8 | namespace nodegen_help_project; 9 | 10 | public static class BoidSimulation 11 | { 12 | public static void SimulateBoidMovement( 13 | IEnumerable positions, 14 | IEnumerable velocities, 15 | float alignmentStrength, 16 | float cohesionStrength, 17 | float separationStrength, 18 | float separationDistance, 19 | out IEnumerable updatedPositions, 20 | out IEnumerable updatedVelocities) 21 | { 22 | var positionList = positions.ToList(); 23 | var velocityList = velocities.ToList(); 24 | var updatedPositionList = new List(); 25 | var updatedVelocityList = new List(); 26 | 27 | for (int i = 0; i < positionList.Count; i++) 28 | { 29 | var position = positionList[i]; 30 | var velocity = velocityList[i]; 31 | 32 | // Alignment - steer towards the average heading of local flockmates 33 | Vector2 alignment = CalculateAlignment(i, positionList, velocityList) * alignmentStrength; 34 | 35 | // Cohesion - steer to move toward the average position of local flockmates 36 | Vector2 cohesion = CalculateCohesion(i, positionList) * cohesionStrength; 37 | 38 | // Separation - steer to avoid crowding local flockmates 39 | Vector2 separation = CalculateSeparation(i, positionList, separationDistance) * separationStrength; 40 | 41 | // Combine the forces 42 | Vector2 acceleration = alignment + cohesion + separation; 43 | 44 | // Update velocity and position 45 | Vector2 newVelocity = velocity + acceleration; 46 | Vector2 newPosition = position + newVelocity; 47 | 48 | updatedVelocityList.Add(newVelocity); 49 | updatedPositionList.Add(newPosition); 50 | } 51 | 52 | updatedPositions = updatedPositionList; 53 | updatedVelocities = updatedVelocityList; 54 | } 55 | 56 | private static Vector2 CalculateAlignment(int index, List positions, List velocities) 57 | { 58 | Vector2 averageVelocity = Vector2.Zero; 59 | int count = 0; 60 | 61 | for (int i = 0; i < positions.Count; i++) 62 | { 63 | if (i != index) 64 | { 65 | averageVelocity += velocities[i]; 66 | count++; 67 | } 68 | } 69 | 70 | if (count > 0) 71 | { 72 | averageVelocity /= count; 73 | } 74 | 75 | return averageVelocity - velocities[index]; 76 | } 77 | 78 | private static Vector2 CalculateCohesion(int index, List positions) 79 | { 80 | Vector2 centerOfMass = Vector2.Zero; 81 | int count = 0; 82 | 83 | for (int i = 0; i < positions.Count; i++) 84 | { 85 | if (i != index) 86 | { 87 | centerOfMass += positions[i]; 88 | count++; 89 | } 90 | } 91 | 92 | if (count > 0) 93 | { 94 | centerOfMass /= count; 95 | return centerOfMass - positions[index]; 96 | } 97 | 98 | return Vector2.Zero; 99 | } 100 | 101 | private static Vector2 CalculateSeparation(int index, List positions, float separationDistance) 102 | { 103 | Vector2 separation = Vector2.Zero; 104 | int count = 0; 105 | 106 | for (int i = 0; i < positions.Count; i++) 107 | { 108 | if (i != index) 109 | { 110 | Vector2 difference = positions[index] - positions[i]; 111 | float distance = difference.Length(); 112 | 113 | if (distance < separationDistance && distance > 0) 114 | { 115 | separation += difference / distance; 116 | count++; 117 | } 118 | } 119 | } 120 | 121 | if (count > 0) 122 | { 123 | separation /= count; 124 | } 125 | 126 | return separation; 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /help/csharp/nodegen-help-project/BreathAnimation.cs: -------------------------------------------------------------------------------- 1 | 2 | ///Generated VL (vvvv gamma) Node using ChatGPT 2022-12-01 3 | ///Via the NodeGen Node Set available at: https://github.com/domjancik/VL.NodeGen 4 | ///For more examples, see: 5 | ///https://thegraybook.vvvv.org/reference/extending/writing-nodes.html#examples 6 | 7 | namespace test_namespace 8 | { 9 | public static class BreathAnimation 10 | { 11 | public static float GetBreathStage(float time) 12 | { 13 | float breathDuration = 5.0f; // Duration of one complete breath cycle in seconds 14 | float inhaleDuration = breathDuration * 0.4f; // Duration of inhale phase as a fraction of breathDuration 15 | float exhaleDuration = breathDuration * 0.6f; // Duration of exhale phase as a fraction of breathDuration 16 | 17 | float breathTime = time % breathDuration; // Time within one breath cycle 18 | 19 | if (breathTime < inhaleDuration) 20 | { 21 | // Inhale phase 22 | float t = breathTime / inhaleDuration; // Normalized time within inhale phase 23 | return EaseInOutQuad(t, 0.0f, 1.0f, 1.0f); 24 | } 25 | else 26 | { 27 | // Exhale phase 28 | float t = (breathTime - inhaleDuration) / exhaleDuration; // Normalized time within exhale phase 29 | return EaseInOutQuad(t, 1.0f, -1.0f, 1.0f); 30 | } 31 | } 32 | 33 | // Easing function for smooth animation 34 | private static float EaseInOutQuad(float t, float b, float c, float d) 35 | { 36 | t /= d / 2.0f; 37 | if (t < 1.0f) 38 | return c / 2.0f * t * t + b; 39 | t--; 40 | return -c / 2.0f * (t * (t - 2.0f) - 1.0f) + b; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /help/csharp/nodegen-help-project/CaesarCipher.cs: -------------------------------------------------------------------------------- 1 | 2 | ///Generated VL (vvvv gamma) Node using ChatGPT April 4, 2023 3 | ///Via the NodeGen Node Set available at: https://github.com/domjancik/VL.NodeGen 4 | ///For more examples, see: 5 | ///https://thegraybook.vvvv.org/reference/extending/writing-nodes.html#examples 6 | 7 | namespace nodegen_help_project; 8 | 9 | public static class CaesarCipher 10 | { 11 | public static string EncryptString(string input, int shift) 12 | { 13 | char[] buffer = input.ToCharArray(); 14 | for (int i = 0; i < buffer.Length; i++) 15 | { 16 | char letter = buffer[i]; 17 | if (char.IsLetter(letter)) 18 | { 19 | char offset = char.IsUpper(letter) ? 'A' : 'a'; 20 | letter = (char)((((letter + shift) - offset) % 26) + offset); 21 | } 22 | buffer[i] = letter; 23 | } 24 | return new string(buffer); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /help/csharp/nodegen-help-project/NuGet.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /help/csharp/nodegen-help-project/StarShapeGenerator.cs: -------------------------------------------------------------------------------- 1 | // Function prompt: 2 | // Create a star shape, with number of ends, inner and outer radius as input and Vector2 list output 3 | 4 | using Stride.Core.Mathematics; 5 | using System.Collections.Generic; 6 | 7 | namespace nodegen_help_project; 8 | 9 | public static class StarShapeGenerator 10 | { 11 | public static IEnumerable CreateStar(int numberOfEnds, float innerRadius, float outerRadius) 12 | { 13 | if (numberOfEnds < 2 || innerRadius <= 0 || outerRadius <= 0 || innerRadius >= outerRadius) 14 | yield break; 15 | 16 | float angleStep = MathUtil.TwoPi / (numberOfEnds * 2); 17 | float currentAngle = 0; 18 | 19 | for (int i = 0; i < numberOfEnds * 2; i++) 20 | { 21 | float radius = (i % 2 == 0) ? outerRadius : innerRadius; 22 | Vector2 point = new Vector2( 23 | radius * MathF.Cos(currentAngle), 24 | radius * MathF.Sin(currentAngle) 25 | ); 26 | yield return point; 27 | currentAngle += angleStep; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /help/csharp/nodegen-help-project/nodegen-help-project.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | True 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /nodegen-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/domjancik/VL.NodeGen/1435b9f9dc5779a477a8278d91bea43f3cc01cb5/nodegen-screenshot.png --------------------------------------------------------------------------------