# Questions tagged [frequency]

The tag has no usage guidance.

21 questions
Filter by
Sorted by
Tagged with
43 views

### Need help with Frequency in pset3. Been stuck for a while

So to start off, I'm going to include my code at the end of the question. Basically, I've built this function a few times now and I'm kind of at my wits end here. My code uses a for loop to iterate ...
50 views

I really don't know what I am doing wrong. I think I've mad a mistake in frequency. Check50 says: :( note C3 has frequency 131 expected "131", not "220" :( note Bb5 has frequency 932 ...
48 views

### Pset3 Frequency Algorithm

I was working through the Pset3 Algorithm, and have all ready written my code, and when check50 runs, I did pretty well. However, the check states that :( produces all correct notes for octaves 3-5 ...
25 views

62 views

### Music frequency accidental and note issue

My music program currently returns values for all notes and accidentals that equals the frequency of note A in that octave, but I cannot make the frequency output change for different notes or ...
129 views

### pset3 load of null pointer of type 'char'

Every time I try to run './synthesize jeopardy.wav < songs/jeopardy.txt' it just prints out: helpers.c:46:17: runtime error: load of null pointer of type 'char' Segmentation fault here is my code:...
72 views

### Calculate n (semitones) for frequency in pset3

I'm having a bit of a hard time trying to calculate the value of n(the number of semitones from A4). I'm currently using the following formula: if (octave > A4_OCTAVE) { n = (octave - ...
277 views

### pset3 music frequency question

I am working on pset3 music frequency. I struggled with finding a pattern of frequencies for different notes, so instead, i created two arrays one with all possible note (C,D,E,F,G,A,B) and another ...
78 views

### Writing the .wav file fails with command-line notes

I have verified that my frequency(note) function returns the correct frequency as an int. However, when I attempt to write out using the "command-line note entry" testing scenario described (and yes ...
138 views

70 views

### pset3 music - unsure what is wrong with my variables

I'm trying to shift the octave of the note and calculate its hertz, but somehow got error messages saying that my variables are unused. How should I fix this problem? My code: // Calculates ...
117 views

My code for Frequency is working well in the 4th Octave as well as any A note, but after that I am getting values all over. I used Debug50 to follow the math, and I've boiled it down to the adjustment ...
565 views

### Pset3 Music frequency returns all 440

My frequency function returns all 440. Been researching and trying possible solutions (turn ints to floats, round, power, etc) but still does it. What am I doing wrong? Thank you! int frequency(...
132 views

### pset3 frequency not calculating correctly or adjusting for octaves

Can someone please look at my helpers.c code for pset3? I worked a lot on this and I am stuck. 'wavelength' (which is frequency) doesn't calculate correctly within octave 4, and my code to add or ...
26 views

### Why are these if-else statements not letting my program compile?

I was wondering what is wrong with these if else statements because this program is not compiling. Any information would be appreciated and any advice please. #include <cs50.h> #include <...
1k views

### Pset3 music frequency

I'm certain my code is waaaay too long for what they are asking me to do, but I'm not sure how to change the thought process. In any case, my check comes back with huge numbers, so the math is wrong ...
127 views

### PSET3 - Frequency giving wrong octave result

I've been trying to figure out the frequency part of this problem, and all of it seems to be running fine as far as I can tell, except for one part: my octave variable is not giving me anything close ...
218 views

### My music program: frequency returning zeros

// Calculates frequency (in Hz) of a note int frequency(string note) { int n,r,a; double oct, z; float x = 0.0; float y = 0.0; char t; t=0; a = 0;r = 0; n = strlen (note)...
499 views

### Problem with pow() function, int frequency, helpers.c, pset3, music

I'm not getting the correct frequencies. When I execute ./notes, C4 through G#4 all return 220, and A4 through B4 return 440. I've determined that the problem must be with pow(), I just don't know ...