Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!

Jon Fil

Ranch Hand
+ Follow
since Nov 07, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
7
Given in last 30 days
7
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jon Fil

Update:

I went and showed my instructor my code for some help and commented out is his feedback:



- How would I even set the size of the picture based on the audio?  If width of 500/44100hz is only 0.01 of a second, then how would it be if the sample length of my audio is 254646 when I do audio.length? Plus the sound file I'm using is only about 6 seconds long.
- If I don't need JFrame, then how would I even get the picture to animate?
- If I don't need the audio to play unless I wanna hear it, does this mean I even have to sync the colors and have picture/color animation at all???
4 days ago
Now, I'm stuck and can't make the color go in sync with the sound.


Should I be using while loop instead or?
4 days ago

Carey Brown wrote:Another thing in your code that is questionable is how you calculate the Color. The double passed in is presumably in the range of -1.0 to +1.0. So your formula (d + 1) / 2 will give you a range of 0.0 to 1.0 and that multiplied by 255 will give you 0 to 255. This is good because that is the valid range for rgb values. However you use multipliers of 355 and 380 for the other two rgb values which will probably overflow the 255 limit.

Where did you get this formula from?



I originally only had

but I was messing with it trying to see different colors instead of just having all same value for color (r, g, b).  I also tried int r., g, b with ...* 255 for all three.
5 days ago
Here's my code now.


Now, how would I make the picture(s) go in sync with the sound?
5 days ago

Carey Brown wrote:The code you pointed at appears to create a simple graph of the audio left & right double values. Is that the kind of "Picture" you have in mind? Also, I'm not familiar with the libraries the instructor is using.



So from the StdAudio, there's a method which Reads audio samples from a file (in .wav or .au format) and returns them as a double array with values between -1.0 and +1.0.
And so I was thinking that maybe those are the values I use for the equations to get values for "1D Array Loc", "col", and "rows".  Then maybe somewhat convert col and row to int to use for and with color of my choice? Idk to be honest
5 days ago

Carey Brown wrote:

Jon Fil wrote:The 4x4 is supposed to be a grid of pixels.


4x4 pixels would be barley visible on a screen. (?)



Oh that 4x4 was just an example.  My instructor drew that to show us and help us "understand" the stuff better.
5 days ago
I think this is similar to what we're supposed to do, demo.

Edit:
5 days ago

Carey Brown wrote:Your "requirements" are very vague. Your diagram shows a 4x4 grid, is that a grid of pixels or images? How would you use sound to compute the Color? I know what a picture is but I don't know what a "Picture" (class?) is. I assume the picture is supposed to change as the sound file is played. How do you sync the process of converting a section of the double array to a picture to move to the next position in the array in sync with the playback? Has your instructor shown you a working demo of an example of what they are looking for?

I'm afraid that without filling some more of the details you aren't likely to get many responses.



The 4x4 is supposed to be a grid of pixels.  I have provided the like to the Picture class, we are supposed to use some of the methods from it.  I believe the double array is supposed to turn into colors.  My instructor didn't not show a demo, he only showed grabbing the array of doubles from a sound file.  I remember he said something about assigning each values to something?  And how were supposed to assign them according to the different kind of values... like negative, if values ends with certain numbers, etc.  I'm actually really confused.  My instructor extended the due date because everyone seems to be struggling as well.
5 days ago

Knute Snortum wrote:Why don't you ask your instructor?




I have emailed him plus it's the weekend.  He'll most likely not check his email til Monday.  Sorry for asking
6 days ago

Mike Simmons wrote:

Jon Fil wrote:


Probably "no comments" - you didn't include any documentation on the method or explanation of what you were doing.



I didn't need to include comments to explain.  I didn't include any comments to the rest of the codes and my instructor didn't take points off.
1 week ago
Hello I'm back once again with more questions

Okay so...
I have to write a program that uses StdAudio and Picture to create an interesting two-dimensional color visualization of a sound file while it is playing.

I'm not sure how to even start this one...

But here's what I know how to do that might possibly help me with making this program:

- Grab the width and height, and the color values(as integers) of each pixels from an image.
- Read the samples from an audio file(.wav) and grab them as an array of doubles.

My instructor gave me some hints and wrote/drew this:


So basically I have to "create" an image using the values of double[]'s that I grab from the sound file? So I actually have to create an image, not pick an image to use? The sound file is supposed to "create" the image for me?
Then use those values from the sound file and plug them in in the equations above? As well as whatever rows, and the width of whatever I want to set it to?
Then whatever results I get from "1D Array Loc % 4 = col" and "1D Array Loc / 4 = row" will be the values I use for ?

Thanks! Any help/feedback would be greatly appreciated!
1 week ago
Just got this project back and graded.
Surprisingly, I received a grade of 7.25 / 8 .

For the actual Deck class, I got a -0.25 for my shuffle method.
Please read the comments.




For my Junit Test, I got a -0.5 .
Surprisingly(no, not really), this is the only block where he took points off.


No errors/comments in this section:

1 week ago
Here is the instruction.





Here's my completed(I think) code.



@Anyone,
Feedback would be greatly appreciated, thanks!
1 week ago