Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. float f_1336 = 1336.0/48000.0;
  2. float f_697 = 697.0/48000.0;
  3. float f_770 = 770.0/48000.0;
  4. float f_852 = 852.0/48000.0;
  5. float f_941 = 941.0/48000.0;
  6.  
  7.  
  8. for (i=0; i<48000; i++)
  9. {
  10. float sample_base = amp*sin(2*PI*f_1336*i);
  11. if (i < one_fourth){
  12. sample = amp*sin(2*PI*f_697*i);
  13. tone = sample_base + sample;
  14.  
  15. }
  16. if (one_fourth < i < 2*one_fourth){
  17. sample = amp*sin(2*PI*f_770*i);
  18. tone = sample_base + sample;
  19. }
  20. if (2*one_fourth < i < 3*one_fourth){
  21. sample = amp*sin(2*PI*f_852*i);
  22. tone = sample_base + sample;
  23. }
  24. if (3*one_fourth < i < 4*one_fourth){
  25. sample = amp*sin(2*PI*f_941*i);
  26. tone = sample_base + sample;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement