Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Head First Beatbox

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I'm working on the Head First Java BeatBox project and I'm really confused on the part where they have the two for loops. I'm not sure what is supposed to go in the checkboxList.get() method. How does it work? They have it as checkboxList.get(j+(16*i)); but if it goes from 1 to 256 shouldn't it be i*j? Also I'm confused about where I can get more information about Java's libraries and classes like MIDI sound. For example, where would I find out information like 35 represents the Bass Drum sound in MIDI sound? I looked in the API documentation but they seem to have limited information. Can you tell me what you use to find detailed information about how certain Java libraries and classes work when you are doing projects? Can you give me a link? Thank you.
 
WanXiang Chen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the HeadFirst code
BB1.PNG
[Thumbnail for BB1.PNG]
BB2.PNG
[Thumbnail for BB2.PNG]
BB3.PNG
[Thumbnail for BB3.PNG]
 
WanXiang Chen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are the rest
BB4.PNG
[Thumbnail for BB4.PNG]
BB5.PNG
[Thumbnail for BB5.PNG]
BB6.PNG
[Thumbnail for BB6.PNG]
 
Marshal
Posts: 70684
288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

WanXiang Chen wrote:. . . checkboxList.get(j*(16*i)); . . . .

Poor printing in your copy. I think it says checkboxList.get(j+(16*i));
 
WanXiang Chen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I’m sorry but can you actually give me some helpful suggestions in regards to my question? Seriously this website sucks.
 
Marshal
Posts: 25960
70
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

WanXiang Chen wrote:I’m sorry but can you actually give me some helpful suggestions in regards to my question? Seriously this website sucks.



Not really. For example you asked about "checkboxList.get(j+(16*i))". So I looked through your post and I couldn't find it. That doesn't mean it isn't there, it might mean that my eyes got tired of looking through six screens full of text (three times) posted as an image and overlooked it. Whereas if you had posted the text I would have found it (or not) instantly.

But you have the text in a file in your computer, right? Why didn't you just post that so we had some hope of being able to deal with it? "Sucks" works both ways.

 
Paul Clapham
Marshal
Posts: 25960
70
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or alternatively you could post a link to wherever you got that example from. Sure, we could google it but why? Help yourself by making it easier for us to help you.
 
Rancher
Posts: 218
16
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you make your question hard to read (i.e. posting screenshots instead of text), you probably won't get too much help. We have no background on your project, so the question is a bit confusing.

The Midi stuff exists in javax.sound.midi. You can find the Javadocs for Sequencer, Track, ShortMesage, and MidiEvent online which are sufficient to play a midi sound.
https://docs.oracle.com/javase/tutorial/sound/overview-MIDI.html
https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/Sequencer.html
https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/Track.html
https://docs.oracle.com/javase/8/docs/api/javax/sound/midi/MidiEvent.html
https://docs.oracle.com/javase/8/docs/api/javax/sound/midi/ShortMessage.html
As well as examples: https://www.geeksforgeeks.org/java-midi/

Make a ShortMessage with a command/channel/note/velocity

You can find stuff about the midi commands on midi.org or guides like this: https://computermusicresource.com/MIDI.Commands.html
Or just mess around with it until you find something you like.

Also it's no one's responsibility to do your homework for you. Everyone here is just helping out in our free time.
 
No thanks. We have all the government we need. This tiny ad would like you to leave now:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic