• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

small audio program help for uni

Joined
May 27, 2008
Messages
3,628 (0.63/day)
System Name Ultra 64
Processor NEC VR4300 (MIPS R4300i)
Motherboard proprietary design
Cooling Fanless aircooled
Memory 4.5MB 250 MHz RDRAM
Video Card(s) 62.5 MHz Reality Coprocessor
Storage 32 - 512 Mbit ROM Cartridge
Display(s) 720x576
Case Clear Blue Funtastic
Audio Device(s) 16-bit CD quality
Power Supply proprietary design
Mouse N64 mouse for use with N64DD
Keyboard N64 keyboard for use with N64DD
for my uni course i have to do a portfolio of different tasks. One is so make a short program that will play a sine wave at a frequency the user has entered then play two others an octave higher and lower. Now the first frequency and time is given to us. They are 1000.0 for frequency and 1000 for time (milliseconds) now my question is how much do i raise and lower the time for to raise and lower the frequency by an octave?
hope that makes sense thanks
 
Joined
Aug 10, 2007
Messages
4,267 (0.70/day)
Location
Sanford, FL, USA
Processor Intel i5-6600
Motherboard ASRock H170M-ITX
Cooling Cooler Master Geminii S524
Memory G.Skill DDR4-2133 16GB (8GB x 2)
Video Card(s) Gigabyte R9-380X 4GB
Storage Samsung 950 EVO 250GB (mSATA)
Display(s) LG 29UM69G-B 2560x1080 IPS
Case Lian Li PC-Q25
Audio Device(s) Realtek ALC892
Power Supply Seasonic SS-460FL2
Mouse Logitech G700s
Keyboard Logitech G110
Software Windows 10 Pro
Isn't it just asking you to playing a frequency for a given time, then play it an octave higher (freq * 2) and then one lower (freq / 2 ), each for the same amount of time?
 
Joined
May 27, 2008
Messages
3,628 (0.63/day)
System Name Ultra 64
Processor NEC VR4300 (MIPS R4300i)
Motherboard proprietary design
Cooling Fanless aircooled
Memory 4.5MB 250 MHz RDRAM
Video Card(s) 62.5 MHz Reality Coprocessor
Storage 32 - 512 Mbit ROM Cartridge
Display(s) 720x576
Case Clear Blue Funtastic
Audio Device(s) 16-bit CD quality
Power Supply proprietary design
Mouse N64 mouse for use with N64DD
Keyboard N64 keyboard for use with N64DD
Isn't it just asking you to playing a frequency for a given time, then play it an octave higher (freq * 2) and then one lower (freq / 2 ), each for the same amount of time?

no, with sine waves (or usualy refered to as sound waves) and strentching or shrinking a wave form to fit the same sine wave in a shorter space of time will either raise its pitch or lower it depending on if you speed up or slow the speed acordingly. I just do not no by how much.

edit:
this is the exact question.
Adapt the program above to play three sine waves. The user should enter a frequency and the program will play the frequency the user entered and sine waves an octave above and below the users frequency. You should do this by changing the milliseconds variable.
 
Joined
Aug 10, 2007
Messages
4,267 (0.70/day)
Location
Sanford, FL, USA
Processor Intel i5-6600
Motherboard ASRock H170M-ITX
Cooling Cooler Master Geminii S524
Memory G.Skill DDR4-2133 16GB (8GB x 2)
Video Card(s) Gigabyte R9-380X 4GB
Storage Samsung 950 EVO 250GB (mSATA)
Display(s) LG 29UM69G-B 2560x1080 IPS
Case Lian Li PC-Q25
Audio Device(s) Realtek ALC892
Power Supply Seasonic SS-460FL2
Mouse Logitech G700s
Keyboard Logitech G110
Software Windows 10 Pro
I believe my way is easier ;)

But since they ask you to do it by changing the duration, to raise an octave you'd need to play the same clip in half the time, as you'd have double the cycles in a given amount of time (effectively doubling the frequency). At least that's my thinking on it... has been 10 years since Multimedia Audio 101 and 11 years since highschool band...
 
Joined
May 27, 2008
Messages
3,628 (0.63/day)
System Name Ultra 64
Processor NEC VR4300 (MIPS R4300i)
Motherboard proprietary design
Cooling Fanless aircooled
Memory 4.5MB 250 MHz RDRAM
Video Card(s) 62.5 MHz Reality Coprocessor
Storage 32 - 512 Mbit ROM Cartridge
Display(s) 720x576
Case Clear Blue Funtastic
Audio Device(s) 16-bit CD quality
Power Supply proprietary design
Mouse N64 mouse for use with N64DD
Keyboard N64 keyboard for use with N64DD
I believe my way is easier ;)

But since they ask you to do it by changing the duration, to raise an octave you'd need to play the same clip in half the time, as you'd have double the cycles in a given amount of time (effectively doubling the frequency). At least that's my thinking on it... has been 10 years since Multimedia Audio 101 and 11 years since highschool band...

aye your way would be easier but hey if i can do it both ways i have a choice i gues:D i think your right i understand the science so to speak behind why it works, having the same amount of peakes of a wave in a shorter time space moves them closer together raising the frequency, and vise versa to lower it, but i just dont no by how much
 
Last edited:

Kreij

Senior Monkey Moderator
Joined
Feb 6, 2007
Messages
13,817 (2.20/day)
Location
Cheeseland (Wisconsin, USA)
Can you post the code for the original program? I'd like to see it.

Thanks :toast:
 
Joined
May 27, 2008
Messages
3,628 (0.63/day)
System Name Ultra 64
Processor NEC VR4300 (MIPS R4300i)
Motherboard proprietary design
Cooling Fanless aircooled
Memory 4.5MB 250 MHz RDRAM
Video Card(s) 62.5 MHz Reality Coprocessor
Storage 32 - 512 Mbit ROM Cartridge
Display(s) 720x576
Case Clear Blue Funtastic
Audio Device(s) 16-bit CD quality
Power Supply proprietary design
Mouse N64 mouse for use with N64DD
Keyboard N64 keyboard for use with N64DD
Can you post the code for the original program? I'd like to see it.

Thanks :toast:

shure thing give me a sec

#include"../audio.h"
#include <iostream>
using namespace std;

int main()
{
// create variables
float frequency;
int milliseconds;

//assign values
milliseconds = 1000;

cout << " enter a frequency" << endl;
cin >> frequency;
return 0;
}

i stopped on it there didnt see the point as i dont no by how much the time needs to changed so moved onto the next question
 

Kreij

Senior Monkey Moderator
Joined
Feb 6, 2007
Messages
13,817 (2.20/day)
Location
Cheeseland (Wisconsin, USA)
If what you teacher wants is a change in freq. based upon a change in time, then the time (milliseconds) is an indicator of the period of the wave (not the duration).

You calculation is ... frequency = 1 / period.

Calculating the period (T) by frequencey is T = 1 / freq.
So T = 1 / (1000 Hz) = .001s (1 millisecond)
at 500HZ T = .002s (2 milliseconds)

I'm still have no idea what the original 1000Hz at 1000ms means, unless the time is the duration, not the periodl.
 

King Wookie

New Member
Joined
Jan 1, 2008
Messages
1,197 (0.20/day)
Location
Johannesburg, South Africa
System Name Blackbox
Processor Intel i5 750 @ stock for now
Motherboard EVGA P55 LE
Cooling Corsair H50 with 2 x Zalman ZM-F3 push/pull
Memory 2 x 2g team extreem DDR3 2000
Video Card(s) Asus GTX 460 Top
Storage Seagate 500.12, Seagate 320.11
Display(s) BenQ FP222W - 22 inches
Case CM 590 with 5x various fans (Thermalright/Noctua)
Audio Device(s) Onboard
Power Supply Corsair HX620
Software XP home SP3
Can't help you with the code, but simply speaking if it goes up and octave, then it doubles in frequency. So 1kHz taken up an octave would be 2kHz.
Up an octave, double the frequency. Down an octave, half the frequency.

And if this helps, the old way of writing it was cycles per second. So 1kHz is 1000 cylces per second.

EDIT: yes, I saying the same thing as Jizzler, but just thought I'd rephrase.
 
Top