| ||||||||||
Question: This GUI will have a string input area where the user can type in a sequence of letters. The letters will define a MIDI sequence. Only the letters c,d,e,f,g,a, and b are allowed, presumed all in the third octave. Lowercase is an eighth note, uppercase is a quarter note. So cEdEgC would be c3 eighth, e3 quarter, d3 eighth, e3 quarter, g3 eighth, c3 quarter., from Homework 6 description. This is what the hw says. I'm kind of confused about the musical part. How exactly are we supposed to get the various notes to play, eg. c3 in eighth, or c3 in quarter? Are we supposed to formulate these sounds or can we get them from somewhere online because all of these sounds are not in our mediasources folder. Could you please provide some clarification. Additionally, will this hw still be due March 30? |
Question: will the lowest homework grade be dropped when calculating the final grade? |
Question: Are we making one node with the input sequence in it or a sequence of nodes, each with one note from the sequence? It doesn't make sense to me to be able to weave with only one node. |
Question: We have the entire GUI set up nicely (appearance wise)... but I'm having a lot of trouble taking whatever string of letters that are input and then trying to convert those to individual notes... I believe that if I had a string to start out with, then I could convert it into notes... but I can't figure out how to take the input string and be able to save it with a certain name, so that I can then mess with it... in "RhythmTool", they use "num = Integer.parseInt(count.getText());" ... but what should we do if it is already a string?? Hopefully that made sense |
Question: We named our input box as so: 'JTextField txt = new JTextField("Type Sequence Here");' ... then we tryed to access the "input" in order to make the node by typing this: 'String seq = new String(txt.getText());'... and this error popped up: 'local variable txt is accessed from within inner class; needs to be declared final' ... i have no idea how to gather the "input" and save it as a string... please help |
Question: Should the "MakeNode" button add the current sequence to the list, or just make it into a floating node? If the latter, does that mean the RepeatInSequence and WeaveInSequence should be enacted on the node you just made using the "MakeNode" command, or should they be enacted on the sequence currently in the input area? |
Question: Professor Guzdial gave us a method that would turn the string into a phrase in class today. Does this method need to be inside our MidiTool or where would we add that method. I'm confused with this whole GUI thing and how it works. |
Question: Can we modify song node to make it do what we want or are we stuck with the default thing? |
Question: When we tried to implement the code prof Guzdial gave us today it kept telling us that Note was not a class. The specific lines were:Note myNote = null; if (c == 'A') myNote = new Note(JMC.A3, JMC.QN);Is Note even a class? If so where is it located? |
Question: We're getting this error when we push our make node button. We're making our node by getting all the note values, putting them into a phrase, and then putting the phrase into a node. Any idea what's causing all this?Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at MidiTool$2.actionPerformed(MidiTool.java:124) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) ...lots moreThanks |
Question: Is there a way to turn a note into a sound? |
Question: "WeaveInSequence weaves the currently made node into the sequence every-other node onto the end. "We're a bit confused about what this statement means. Should we be weaving in the node every 1 node, or every 2 nodes? I.e., if we have six nodes, A B C D E F, and we want to weave in G, would it result in A G B G C..... or A B G C D G....? |
Question: We're trying to make it so that, if there are no numbers typed into the text field for the RepeatInSequence button, it prints out a line telling you to type in a number. But we are having a lot of difficulty writing an if statement to print this. We keep getting:Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at MidiTool$4.actionPerformed(MidiTool.java:140) ...etc...Any ideas? |
Alright, I've made that change, but it's still not working. Using if (count.getText() == null)(where count is the JTextField) doesn't seem to do anything; I've tried commenting the code various ways, and it seems that the String is never being equal to null, even if I don't type anything. Any ideas? |
final JTextField repeatInSequenceTextField = new JTextField(null,5); //The following should be in the ActionListener if(repeatInSequenceTextField.getText()==null){ //Do stuff }I think the problem is that "" != null. So if the contents of your JTextField either defaults to "" or set to "", it's not equal to null! "" is actually a String with a length of 0. Thus another way to approach this would be to do
final JTextField repeatInSequenceTextField = new JTextField("",5); //The following should be in the ActionListener if (repeatInSequenceTextField.getText().length() == 0){ //Do stuff }Dawn Finney.
Question: For the "Weave Node" button we are cunfused about what we actually weave the node with. Do we add the node to the end of the sequence and then add the sequence to the end of the node? Some clarification would be great. Also how do we play the node and/or sequence without using showFromMeOn? I mean how can we just get the stuff to play when we hit the button? |
Question: I am having a problem with the weave and repeat buttons. When i use these buttons to weave in or repeat a new sequence, it just repeats or weaves in the original songnode. Im thinking my problem is that I do not have the buttons reading the txtfield and make a new songnode but when i tried to fix that it still weaves in the original song node. any ideas? |
Question: For the makeNode button: when trying to make a class that will handle making the input letters into notes to put into a phrase, I get an error 'illegal start of expression'. Here's my code:makeNode.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { public method buildPhrase (String str) { ...then my code |
Okay I've tried 'class' 'String' 'Object' 'object' 'void' 'Phrase' instead of 'method'....nothing works |
Question: in my interactions panel I typed the following after importing all the requisite stuff:Note noteCLower = new Note(JMC.C3,JMC.EIGHTH_NOTE); Phrase phr1=new Phrase(); phr1.addNote(noteCLower.copy()); Play play=new Play(); play.midi(phr1);It plays the note, and then a separate panel pops up and says: "The Interactions Window Terminated by a call to System.exit(0). The Interactions window will now be restarted."The reason I ask is that I am trying to use code like this in my program and I am getting the same termination message. Thanks |
Question: I have tried two different ways to construct my phrase from the input, but when I test it, i get something totally different, for example if I put in ABC, I get a phrase that will have A, AB ,ABC it seems like I only need the last part but I dont know why it is showing all the other stuff before that. |
Question: Our code works fine if we use single notes as input, but if we try to input a string of notes longer than 2 (ie. ABC) for repeating or weaving we get an error: Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space... (along with a bunch of red messages). How can we fix that to compose more interesting things? |
Question: I am trying to apply a method I made up to "root"(which is a SongNode) inside of an inner class. I am getting the following error message:File: C:\cs1316\java-source-Fall06\java-source-Fall06\MidiTool.java [line: 156] Error: C:\cs1316\java-source-Fall06\java-source-Fall06\MidiTool.java:156: variable root might not have been initializedwhat is happening? |
public class Text1{ public static void main(String[]args){ String s; s = s + "string"; } } 1 error found: File: C:\Documents and Settings\Nwad\Text1.java [line: 4] Error: variable s might not have been initializedDawn Finney.
Question: As we do what Guzdial says and we make the same nodes listed above, and we get to the weave button, we have an extra ccc, but it shows as the first node in the sequence. Is this ok, or should we fix it and what are suggestions on how to go about doing that. |
Question: Do we have to turn in a pairs work sheet to the TA's again? and if so, where does it go? |
Question: how can you tell if your weave actually works. ive read through all the weave questions but i still dont really get how you can tell if your using the same sequenced node for everything. the effect of weave would look just like repeat. |