need help with my jazz improvisation program

This is a discussion on need help with my jazz improvisation program within the C Programming forums, part of the General Programming Boards category; ok so here is my problem i have to make a program that improvises jazz music this is my loop ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    3

    need help with my jazz improvisation program

    ok so here is my problem
    i have to make a program that improvises jazz music

    this is my loop
    Code:
    do
    	{
    	music(transposition, tempo);
    	piano(transposition, tempo);
    	}
    
    	while(kbhit() !=1);
    music function plays a random note for a random time
    and piano does the same, but with a random chord

    currently they play one after the other
    but i need to know how to get both functions running together

    i dunno if you can make 2 simultaneous loops or something

    any help guys??

    much appreciated, Ben

  2. #2
    Registered User
    Join Date
    Mar 2005
    Posts
    135
    I believe you would have to use threads for this or some predefined asynchronous media functions. What OS are you working under?


    xeddiex.
    Last edited by xeddiex; 01-15-2006 at 06:42 PM.

  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    3
    im running windows xp

    i have no idea wat threads are though

  4. #4
    Registered User
    Join Date
    Mar 2005
    Posts
    135
    If you don't care about portability, you could use the simple PlaySound function from the Win32 API (keep in mind it's limited to .wav files only). It also let's you play more than one audio file concurrently. But to do so, thouh, you would have to create a Win32 Console Application Project first. What compiler are you using? Oh,.. and, you only need one loop - not two.

    If portability is a concern, I would probably look into FMOD.


    xeddiex.

  5. #5
    Registered User
    Join Date
    Jan 2006
    Posts
    3
    im playing the sounds through the midi module, using a library that the university has

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 12:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 12:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 09:39 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21