For musicians: project to adjust song lyrics (text files) so that chords can be either within or floating above.
Compare "Flat" vs "Lifted" versions of a song. Here's color inversion of the picture above, which is from "inline chords" document of Mike's google classroom.
2022f Jun 3
Run tests! They work in IntelliJ (green arrows) & BlueJ ("Run Tests"). The IDE's want to open either project1-superstring (folder for blueJ) or IDEA-SuperString/test_sup_str (folder for intelliJ) directories.
Mike, 2021-2, with ideas from Cole, Sadie, Jia, Max, & Desi.
Currently working on making SuperString.java's string handling so we can ask for "word" I, or "item" J, or "line" K of a SuperString. We can also ask to getNextChord (or getNextLyric) of it, and we can build a new SuperString from the results of chopFirstChord (or chopFirstLyric).
See Java 8 String commands including
String.indexOf( ‘k‘ )
// ‘ ‘ and “ “ are both usableString.indexOf( ‘m‘, startAt )
// ‘ ‘ and “ “ are both usableString.substring( start, endBefore )
String.isEmpty( )
String.length( )
// yes, ( )String.split( "\s" )
needs import java.util.regex.*;String.split( "\s", 0 )
// better, avoids empty trailing substringsString.trim( )
// removes all of any blank space before & after!
- junit 4 or 5,
- java8 or better (import java.util.ArrayList),
- shared package of SuperString and SuperStringTest.
[ ] SuperStringTest should be sure null and "" isEmpty( ) strings don't crash out!
[ ] Maybe SuperString should be StringChomper with static commands for String disassembly.
[ ] Block setText( ) so it only accepts legit ("" but not null?) Strings.
[ ] Turn wanna-be-tests into real tests! See the starter examples in ChordShifterText.java!
[ ] Consider having separate folders (branches!?) for "starter" and "answer-key" versions.
[ ] Revise example picture and all code to use {Chord} rather than [Chord].
[ ] See openfjx info which suggests finding JavaFX libraries and use IntelliJ's file:projectStructure:Library to tell IntelliJ where javafx libs live. See stackoverflow article re javafx which explains that java8 came with javafx but java 11+ don't and need the openjfx install mentioned above. (IntelliJ wants jdk 11 or 17 for JavaFX. BlueJ is running JavaFX (8 probably) in my chordlifter but IntelliJ isn't. IntelliJ was able to make a new project in different folder "demoJavaFX" which runs and acquired its own javaFX (11+?) from somewhere.)
[ ] Use Bluej's example of file reader for SuperString.getTextFromFile( )
See done in separate document in proj-history directory
- Possible implementation of symbol table: keys & values (with hashmap)
- Possible implementation of song: linked list
- MVC!
- Extra features: search for melody snippets in multiple songs!
- Kinds of data we could track: who sings which verse, which instruments play which notes.
- Include note hints, e.g. ( c d e fh )
- If {Am Bm} are in one bracket enclosure, is that one "chord" or two???
- Is "never {G}gonna" acceptable or better/worse than "never {G} gonna" in terms of spaces??
- Should we always make sure output has at least one space between all "lyric" and "chord" things?
- BlueJ didn't at first run the ChordTest that intelliJ had made, and didn't stick it to Chord class until I told blueJ to make its own ChordTest. BlueJ squawked about it existing already, and moved the intelliJ test into position.
- IntelliJ doesn't import as much for its tests, and has to specify longer prefixes.
- To see the TextDialogExamples (there are separate directories for the BlueJ and IntelliJ versions.
-
- When running BlueJ, right click TextDialogExample & "Run JavaFX Application" (the "new TextDialogExample" doesn't seem to work May 2022).
-
- When running IntelliJ, can use its terminal to
javac TextDialogExample.java
andjava TextDialogExample
.
- When running IntelliJ, can use its terminal to
- IntelliJ new Project on new install has option to download java 18 (other versions avail) and wants to put it into ~/Library/Java/JavaVirtualMachines/openjdk-18.0.1.1
- IntelliJ: new Java files should go into the "src" folder, else "Run" has trouble finding them.
- IntelliJ: community edition can become education by merely adding the EduTools Plugin.
- IntelliJ: reasonable package com.michaelroam.hellomilton; // we should put it top of all interactors
- IntelliJ: nice "sout" and "psv" code replace/complete give System.out.println("") with cursor inside quotes! and public static void main(.
- Github iPad app doesn't allow file editing, just reading; use ipad's Safari to go to http://github.com/mroam/chordlifter and EDIT!
- Markdown Cheatsheet
- BlueJ IDE for Java & Stride is cool in visual display of Classes, Tests, and interactive instances.
- IDEA IntelliJ IDE for Java & others's starter & overview info.
- JUnit 5 usrguide (Junit 5 has "jupiter", is 1st class on intelliJ, and needs Java8 or better.)
- Junit 5 API and especially kinds of Assertions