0

I am trying to imitate a string instrument. I have a ring buffer implemented as a Linked List with all of the values initialized at 0 to represent a sine wave at rest.

I am writing a pluck() method that replaces the N elements(all values currently at 0) in the buffer with N samples of a single sine wave with values between -.5 and +5.

Can you help me with the math aspect of making this happen?

1
  • 1
    "Can you help me with the math aspect of making this happen?" You most likely won't find a tutor on SO, since that is not what it is for. You'll have better luck showing what you have tried and asking a specific question. Also, don't forget to add a question mark to questions. As it stands, I am voting to close this as 'not a real question'. Aug 30, 2012 at 0:39

1 Answer 1

0

You have to create a sine function for your fundamental frequency, and others if you want to introduce harmonics (with sqrt(2) frequencies ratio), then add an attack slope and duration, idem for sustain and release. This is the basics of old-school electronic music :)

2
  • "idem for sustain and release" DYM 'item'? What is an 'idem'? Aug 30, 2012 at 0:54
  • 1
    idem is latin for "the same thing".
    – moonwave99
    Aug 30, 2012 at 0:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.