User Profile

Collapse

Profile Sidebar

Collapse
Wiebo
Wiebo
Last Activity: Apr 24 '07, 08:24 AM
Joined: Apr 20 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Wiebo
    replied to Help with Additive Synthesis
    in C
    That is correct, although I thought that having the following line would keep adding the current value of the sine wave 'a' into output and it would build up until all 34 waves are together as one sound.

    Code:
    output = (buffer[a] + output)/2;

    This part I don't quite understand, the number of samples is 44100 a second, and at the moment it is a 10 second sine wave, and this can change....
    See more | Go to post

    Leave a comment:


  • Wiebo
    replied to Help with Additive Synthesis
    in C
    Heres the whole part of the code, including both loops.
    Code:
    int main()
    {
    	//Create ne wav file
    	CWavFile file;
    	file.newWav(SR, 16, 1000, 1);
    	float f = 10;		//frequency
    	float PIX2 = PI*2;
    	float wave;
    	float gain;
    	int g = 0;
    	float buffer[34];	//no. voices
    
    for(int a = 0; a < 34; a++)
    	{
    		gain = 1;
    		
    		for(int i = 0;
    ...
    See more | Go to post

    Leave a comment:


  • Wiebo
    replied to Help with Additive Synthesis
    in C
    'a' refers to an integer, which is declared previously as part of another while loop to allow the program to run through the above piece of code for each instance of a sine wave. The buffer is merely there to hold the samples before it is then added to 'output'.

    Hope that helps...
    See more | Go to post

    Leave a comment:


  • Wiebo
    replied to Help with Additive Synthesis
    in C
    I did expect that to happen but i'm not getting that, all I would get at the end is a sine wave at say 320Hz.

    The problem is that the sine waves don't seem to combine...
    See more | Go to post

    Leave a comment:


  • Wiebo
    started a topic Help with Additive Synthesis
    in C

    Help with Additive Synthesis

    Hi, i've been trying to combine a number of sine waves together for the past few days without any luck. No processes i've found on the internet seem to work for me.

    I have code which creates different sine waves at different frequencies, but it always only plays the final frequency, so any pointers on what I should do with this code would be appreciated.
    Code:
    for(int i = 0; i < file.getNumSamples(); i++)
    		{
    ...
    See more | Go to post
No activity results to display
Show More
Working...