Skip to main content

Questions tagged [music]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
45 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 ...
SICES94's user avatar
0 votes
2 answers
45 views

Pset3, Issue with duration in helpers. Can't compile, strange error message

Back again, this time trying to figure out pset3. I think everone is familiar with the pset, but for anyone who isn't, I'm trying to convert a fraction (1/8, 1/4, 1/2, etc) to a number of eighths. ...
deluciajames's user avatar
0 votes
1 answer
55 views

CS50 Pset 3 Music errors - please help! :(

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 ...
user avatar
0 votes
1 answer
144 views

Please help!! I am facing problem in pset3

I am facing problem in understanding the meaning of------ helpers.c:90:3: error: expected identifier or '(' Please guide me in correcting this error. Thanks a lot in advance.
Padma's user avatar
  • 11
0 votes
1 answer
64 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 ...
tswinn's user avatar
  • 3
0 votes
1 answer
83 views

PSET3: Music, getting this error 'expected exit code 0, not 1'

Please I'm getting this error when I try to submit pset3. expected exit code 0, not 1 My code for synthesizing works fine and I'm able to play wav files from text files. I'm not sure if it's ok ...
Babalola Rotimi's user avatar
0 votes
1 answer
35 views

music pset - semantic error

I implemented the music program in pc and I omitted the cs50.h library since I work offline most of the time. Everything's fine actually my code did not give me error messages and it compiled ...
Gibson's user avatar
  • 3
0 votes
1 answer
82 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 - ...
C_1992's user avatar
  • 3
0 votes
1 answer
183 views

pset3 check50 error message: " :( bday.txt is correct "

In pset3 (music), while checking my version of helpers.c and bday.txt for correctness, I get the error message :( bday.txt is correct - Expected 25 lines in bday.txt, but yours has 0 As far as I ...
Peter Pesch's user avatar
  • 1,009
0 votes
1 answer
39 views

Pest 3 Music frequency

could you help me to look at my codes, all my output frequency turn out 440. I am stuck in this for a week. int accidental = 0; int octave; if (strlen(note) == 3 ) { octave = atoi(&note[2]); ...
WEI-WEN HUNG's user avatar
0 votes
1 answer
102 views

check50 cs50/2018/x/music Failing

https://cs50.me/submit50/results/ramynasr/2da60275db4805137478dc9b9dd4d649c3484355 I keep getting: :( helpers.c compiles expected exit code 0, not 1 Log running clang -std=c11 -o is_rest is_rest....
Ramy Nasr's user avatar
  • 101
0 votes
1 answer
121 views

How to "make notes" file in pset3 ?

This is a really basic question, but I can't "make notes" in pset 3 . I don't know what is wrong. Here is what I do: I tried the following, but maybe it's wrong because "notes" is not a directory ...
John's user avatar
  • 7
-1 votes
1 answer
2k views

Incompatible Integer to Pointer Conversion

int duration(string fraction) { int numerator; int denominator; int factor; // The factor will store the value of the number which the fraction needs to be multiplied for its ...
Aisha's user avatar
  • 19
0 votes
1 answer
286 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 ...
Issa's user avatar
  • 27
0 votes
1 answer
399 views

is_rest() and duration() bugs in helpers.c of Pset3 Music

// Helper functions for music #include <stdio.h> #include <cs50.h> #include <string.h> #include <math.h> #include "helpers.h" // Converts a fraction formatted as X/Y to ...
D.Tan's user avatar
  • 3
0 votes
1 answer
642 views

pset3 music - value inf is outside the range of representable values of type 'int'

When I ran my code through the compiler for notes.c, I got the following error: helpers.c:88:26: runtime error: value inf is outside the range of representable values of type 'int'. It then returned ...
Prav Elan's user avatar
0 votes
2 answers
72 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 ...
Michelle's user avatar
0 votes
1 answer
111 views

Pset 3 Music. Brute forced the frequency function, no syntax errors but only getting 0's for all my answers? Any Ideas?

I know my code is not clean at all. For the frequency function I just brute forced it by just starting with "what if there were only A's?" and copied that for the rest of the letters. Naturally messy ...
Ali Halawa's user avatar
0 votes
1 answer
282 views

PSET3 Music problem: \377

I've finished pset3 - Music, it compiles and runs pretty well, but a strange bug happens in frequency function. If a note value contains either a sharp # or a flat b, the value of char semitone gets ...
OlikovArtyom's user avatar
0 votes
2 answers
49 views

Returning an int always returns 0

For music, check50 always returns 0. Here's my code: int duration(string fraction) { int numer = fraction[0] - '0'; int denom = fraction[2] - '0'; int result = ((numer / denom) * 8); ...
Shay Subramanian's user avatar
0 votes
1 answer
68 views

please help! I've been trying to find out whats the problem in this code for a very long time now... its not even compliling .. #pset3 cs50 #music

please help! I've been trying to find out whats the problem in this code for a very long time now... its not even compliling .. #pset3 cs50 #music // Helper functions for music #include <c s50.h&...
user21692's user avatar
0 votes
1 answer
86 views

PSET3 - MUSIC - check50 not recognising enharmonics

My code uses the minor scale pattern to calculate semitone distances and thus, frequencies of each note, and the "produces all correct notes for octaves 3-5" passes but fails for Ab3 and Bb5. I ...
Kel's user avatar
  • 3
0 votes
1 answer
127 views

Pset3 - Music: Unused parameters and control reaches end of non-void function errors

I have tried and googled everything, but I cannot seem to fix these mysterious errors. Within my helpers.c file, it is saying that I haven't used any of the parameters although I've used all of them. ...
aherzfeld's user avatar
0 votes
2 answers
133 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 ...
Marie Urbina's user avatar
0 votes
1 answer
131 views

headers.c in music clang: error: linker command failed

it looks like my file compiles but it doesn't work correctly, and I get this msg: clang: error: linker command failed with exit code 1 (use -v to see invocation) Any help much appreciated. // ...
Marie Urbina's user avatar
0 votes
1 answer
226 views

pset3/music/helpers.c - "no makefile found"

This is probably a very silly question with a very simple answer, but it has been torturing me for several days now. I want to try to compile notes.c and synthesize.c to see if the code I wrote in ...
Megan Tallon's user avatar
0 votes
1 answer
107 views

Pset3 - 'Error Loading Audio File'

Whenever I attempt to synthesize a new .wav file, the notes come out extremely long (over 1:30 each when played in windows media player) and my .wav file is over 200 MB when inputting the notes to ...
Matt's user avatar
  • 5
0 votes
1 answer
27 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 <...
David Mark Serrano's user avatar
0 votes
1 answer
839 views

Pset3 Music - Issues with bool is_rest function

bool is_rest(string s) { if (strcmp(s, "")) { return 0; } else { return 1; } } I'm having some very strange problems with the bool is_rest function. The code I have actually ...
user avatar
0 votes
1 answer
81 views

Pset3: Music - how am I supposed to get pow() to parse 1/12ths?

I've been stuck on this for what feels like hours, but I simply don't understand how to get the pow() function to properly deal with n twelfths of 2 I've tried this { double base_hz = 440.00; ...
user avatar
0 votes
1 answer
219 views

is my implementation of is_rest correct?

I don't know how to check this function's correctness, but when I compare my code to other people I seem to have the idea right. Can someone tell me the correct implementation of this code? // ...
David's user avatar
  • 11
0 votes
1 answer
311 views

Pset3/Music can't check until a frown turns upside down

i got this message when i tried to check50 of music problem "can't check until a frown turns upside down", i couldn't find what is cause of the problem, so i'll be thankful if someone give me a hand ...
Sengo's user avatar
  • 7
0 votes
1 answer
403 views

CS50 pset3 music - EOF segmentation fault

I've compiled notes and synthesize using cmd make without any errors. running notes works just fine but when I run synthesize, it gives a segmentation error when I pass EOF command (ctr+D). I've gone ...
Kenechi Nzewi's user avatar
0 votes
3 answers
2k views

Pset3 music - load of null pointer of type 'char'

So I just finished up pset3 and when I run checks for correctness and style everything comes up good. The only issue I seem to be having is if I go to manually test with ./synthesize test.wav then ...
DylieWylie's user avatar
0 votes
1 answer
223 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)...
gvr's user avatar
  • 4
0 votes
1 answer
159 views

Pset3 Music - "unused parameter" and "reaching end of non-void function"

I've been working on my music code for quite some time now, and keep running into the same issue. Whenever I try to compile my code, I get "unused parameter" and "control reaches end of non-void ...
Pittsford.N's user avatar
0 votes
1 answer
333 views

Music: Error loading audio file

I have finished Pset 3 with no issues compiling or any issues with check50. However, when I try to play the .wav file that I have generated using ./synthesize jeopardy.wav < songs/jeopardy.txt, the ...
Christie Etter's user avatar
0 votes
1 answer
508 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 ...
IMH's user avatar
  • 3
0 votes
1 answer
92 views

the code always returns 1 and also when i compile it, there is a long message

> 
> 
> 
> int frequency(string note) { char n = note[0]; //defines the octave of the note char o = note[strlen(note) - 1]; //checks if the note is within ...
Kushagra Chawda's user avatar
0 votes
2 answers
253 views

signed integer overflow

I have condition to give me Hz of the octave but I got an error 51:16: runtime error: signed integer overflow: 1845493760 * 2 cannot be represented in type 'int' for line for (int j = 0; 4 + j < ...
koko loko's user avatar
0 votes
1 answer
2k views

control reaches end of non-void function

I have problem with my code (I guess). I have got the control reaches end of non-void function error even though my ifs (i think so ;) ) are covering all of the possibilities. Please have a look: ...
koko loko's user avatar
2 votes
1 answer
844 views

Pset3 Helpers.c Frequency Not Working

Right now I am working on Pset3 with Music. I'm focusing on getting the frequency (in Hz) of all the octaves of A. I am including accidentals in my work as well. The problem is that A4 returns 449 ...
Tenacity's user avatar
  • 157