We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I'm so new with this. I want to spilt the lyric into alphabets/letters so I could play around with the letter's shape and form.
So from the code I tried to split rLyrics (lyrics) by the delimiters indicated. The problem I think it's in the end of my void lyricsDisplay, I think I got it wrong.
thank you in advance
import geomerative.*;
import org.apache.batik.svggen.font.table.*;
import org.apache.batik.svggen.font.*;
MMTrack mmt;
String apiKey ="_";
MusixMatch musixMatch = new MusixMatch(apiKey);
String delimiters = " ,.?!;:\n()*";
String songTitle = "hello";
String songArtist = "adele";
String rLyrics;
void setup() {
size(900, 600);
smooth();
mmt = new MMTrack();
}
void draw(){
translate(width/2, height/2);
background(0);
mmt.lyricsDisplay();
}
class MMTrack {
int id;
int albumId;
String albumName;
String artistId;
String artistName;
String lyrics;
String[] finalText;
String trackName;
float offsetX;
float offsetY;
float leftCol;
float topRow;
float panX;
float endX;
int[] matches;
MMTrack(int id_, int albumId_, String albumName_, String artistId_, String artistName_, String lyrics_, String trackName_) {
id = id_;
albumId = albumId_;
albumName = albumName_;
artistId = artistId_;
artistName = artistName_;
lyrics = lyrics_;
rLyrics = lyrics;
trackName = trackName_;
}
void lyricsDisplay() {
splitlyrics= splitTokens(lyrics, delimiters);
text(splitlyrics, 0, 50);
}
}
Answers
You're doing all the effort of splitting the lyrics up EVERY FRAME. Maybe you could do the splitting in the class's constructor, and save the split result?