diff --git a/blue-core/src/main/java/blue/noteProcessor/TempoMapper.java b/blue-core/src/main/java/blue/noteProcessor/TempoMapper.java deleted file mode 100644 index 3d3616df8..000000000 --- a/blue-core/src/main/java/blue/noteProcessor/TempoMapper.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * blue - object composition environment for csound - * Copyright (c) 2000-2006 Steven Yi (stevenyi@gmail.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING.LIB. If not, write to - * the Free Software Foundation Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307 USA - */ -package blue.noteProcessor; - -import java.util.StringTokenizer; -import org.apache.commons.lang3.text.StrBuilder; - -public class TempoMapper { - - BeatTempoPair[] timeMap; - - private TempoMapper() { - } - - public static TempoMapper createTempoMapper(String timeWarpString) { - TempoMapper tm = new TempoMapper(); - StringTokenizer st = new StringTokenizer(timeWarpString); - String time, tempo; - BeatTempoPair temp; - - if (st.countTokens() % 2 != 0) { - // not an even amount of tokens! - return null; - } - - tm.timeMap = new BeatTempoPair[st.countTokens() / 2]; - int index = 0; - - BeatTempoPair[] tMap = tm.timeMap; - - while (st.hasMoreTokens()) { - try { - time = st.nextToken(); - tempo = st.nextToken(); - - temp = new BeatTempoPair(); - temp.beat = Double.parseDouble(time); - temp.tempo = Double.parseDouble(tempo); - - if (temp.beat < 0.0f || temp.tempo <= 0.0f) { - return null; - } - - tMap[index] = temp; - - if (index > 0) { - - double factor1 = 60.0f / tMap[index - 1].tempo; - double factor2 = 60.0f / tMap[index].tempo; - double deltaBeat = tMap[index].beat - tMap[index - 1].beat; - - double acceleration = 0.0f; - - if (deltaBeat >= 0.0f) { - acceleration = (factor2 - factor1) - / (tMap[index].beat - tMap[index - 1].beat); - } - - if (tMap[index].beat == tMap[index - 1].beat) { - tMap[index].accumulatedTime = - tMap[index - 1].accumulatedTime; - } else { - tMap[index].accumulatedTime = - tMap[index - 1].accumulatedTime + - getAreaUnderCurve(factor1, deltaBeat, - acceleration); - } - } - - index++; - } catch (Exception e) { - // if there's any errors whatsoever, return null - // and let the calling procedure handle it - return null; - } - } - return tm; - } - - public double beatsToSeconds(double beat) { - if (beat == 0.0f) { - return 0.0f; - } - - for (int i = 0; i < timeMap.length - 1; i++) { - - if (beat >= timeMap[i].beat && beat < timeMap[i + 1].beat) { - - double factor1 = 60.0f / timeMap[i].tempo; - double factor2 = 60.0f / timeMap[i + 1].tempo; - double deltaBeat = beat - timeMap[i].beat; - - double acceleration; - - if (deltaBeat == 0.0f) { - acceleration = 0; - } else { - acceleration = (factor2 - factor1) - / (timeMap[i + 1].beat - timeMap[i].beat); - } - - double t = getAreaUnderCurve(factor1, deltaBeat, acceleration); - - return timeMap[i].accumulatedTime + t; - } - } - - BeatTempoPair lastTempoPair = timeMap[timeMap.length - 1]; - - double factor1 = 60.0f / lastTempoPair.tempo; - double deltaBeat = beat - lastTempoPair.beat; - - double t = (factor1 * deltaBeat) + lastTempoPair.accumulatedTime; - - return t; - } - - private static double getAreaUnderCurve(double factor1, double deltaBeat, - double acceleration) { - return (factor1 * deltaBeat) - + (0.5f * acceleration * Math.pow(deltaBeat, 2)); - } - - public double secondsToBeats(double seconds) { - if (seconds == 0.0f) { - return 0.0f; - } - - if (timeMap.length == 1) { - double factor = timeMap[0].tempo / 60.0f; - return seconds * factor; - } - - for (int i = 0; i < timeMap.length - 1; i++) { - if (seconds < timeMap[i + 1].accumulatedTime) { - /* - * BASED ON CODE BY ISTVAN VARGA Csound Mailing List - April 13, - * 2006 - * - * beat0: time in beats at beginning of segment beat1: time in - * beats at end of segment time0: time in seconds at beginning - * of segment btime0: (60 / tempo) at beginning of segment - * btime1: (60 / tempo) at end of segment - */ - - double beat0 = timeMap[i].beat; - double beat1 = timeMap[i + 1].beat; - double time0 = timeMap[i].accumulatedTime; - - double btime0 = (60 / timeMap[i].tempo); - double btime1 = (60 / timeMap[i + 1].tempo); - - double x; - - if(btime0 == btime1) { - double elapsedTime = seconds - time0; - x = elapsedTime / btime0; - } else { - double a = 0.5f * (btime1 - btime0) / (beat1 - beat0); - double b = btime0; - double c = time0 - seconds; - x = (Math.sqrt(b * b - (4 * a * c)) - b) - / (2 * a); - } - - return (x + beat0); - - } - } - - BeatTempoPair last = timeMap[timeMap.length - 1]; - double beat = last.beat; - - double factor = last.tempo / 60.0f; - - return ((seconds - last.accumulatedTime) * factor) + beat; - - } - - @Override - public String toString() { - StrBuilder buffer = new StrBuilder(); - - buffer.append("[TempoMapper]").append("\n"); - - for (int i = 0; i < timeMap.length; i++) { - BeatTempoPair pair = timeMap[i]; - - buffer.append(pair.beat).append(" : ").append(pair.tempo).append( - "\n"); - } - - return buffer.toString(); - } - - private static class BeatTempoPair { - - public double beat = 0.0f; - - public double tempo = 60.0f; - - public double accumulatedTime = 0.0f; - } -} \ No newline at end of file diff --git a/blue-core/src/main/java/blue/noteProcessor/TimeWarpProcessor.java b/blue-core/src/main/java/blue/noteProcessor/TimeWarpProcessor.java index 649d44783..003e130ca 100644 --- a/blue-core/src/main/java/blue/noteProcessor/TimeWarpProcessor.java +++ b/blue-core/src/main/java/blue/noteProcessor/TimeWarpProcessor.java @@ -5,6 +5,7 @@ import blue.soundObject.Note; import blue.soundObject.NoteList; import blue.soundObject.NoteParseException; +import blue.time.TempoMap; import electric.xml.Element; /** @@ -37,7 +38,7 @@ public TimeWarpProcessor(TimeWarpProcessor twp) { @Override public NoteList processNotes(NoteList in) throws NoteProcessorException { Note temp; - TempoMapper tm = TempoMapper.createTempoMapper(this.timeWarpString); + TempoMap tm = TempoMap.createTempoMap(this.timeWarpString); if (tm == null) { throw new NoteProcessorException(this, BlueSystem diff --git a/blue-core/src/main/java/blue/time/TempoMap.java b/blue-core/src/main/java/blue/time/TempoMap.java index 9141be00f..bbdfd8b78 100644 --- a/blue-core/src/main/java/blue/time/TempoMap.java +++ b/blue-core/src/main/java/blue/time/TempoMap.java @@ -1,6 +1,6 @@ /* * blue - object composition environment for csound - * Copyright (c) 2023 Steven Yi (stevenyi@gmail.com) + * Copyright (c) 2000-2006, 2023 Steven Yi (stevenyi@gmail.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published @@ -213,7 +213,7 @@ public double secondsToBeats(double seconds) { public String toString() { StringBuilder buffer = new StringBuilder(); - buffer.append("[TempoMapper]").append("\n"); + buffer.append("[TempoMap]").append("\n"); for (BeatTempoPair pair : timeMap) { buffer.append(pair.beat).append(" : ").append(pair.tempo).append( diff --git a/blue-csnd6/src/main/java/blue/csnd6/render/CS6DiskRendererService.java b/blue-csnd6/src/main/java/blue/csnd6/render/CS6DiskRendererService.java index 1b9dce8eb..52f0df95b 100644 --- a/blue-csnd6/src/main/java/blue/csnd6/render/CS6DiskRendererService.java +++ b/blue-csnd6/src/main/java/blue/csnd6/render/CS6DiskRendererService.java @@ -9,7 +9,6 @@ import blue.automation.Parameter; import blue.event.PlayModeListener; -import blue.noteProcessor.TempoMapper; import blue.score.ScoreGenerationException; import blue.services.render.CSDRenderService; import blue.services.render.CsdRenderResult; @@ -17,9 +16,26 @@ import blue.services.render.DiskRenderService; import blue.services.render.RenderTimeManager; import blue.settings.PlaybackSettings; +import blue.time.TempoMap; import blue.utility.FileUtilities; import com.kunstmusik.csoundjni.Csound; +import java.awt.Color; +import java.io.IOException; +import org.openide.util.Exceptions; +import org.openide.util.Lookup; +import org.openide.windows.IOColors; +import org.openide.windows.IOProvider; +import org.openide.windows.InputOutput; +import blue.score.ScoreGenerationException; +import blue.services.render.CSDRenderService; +import blue.services.render.CsdRenderResult; +import blue.services.render.DiskRenderJob; +import blue.services.render.DiskRenderService; +import blue.services.render.RenderTimeManager; +import blue.settings.PlaybackSettings; +import blue.utility.FileUtilities; +import com.kunstmusik.csoundjni.Csound; import java.awt.Color; import java.io.IOException; import org.openide.util.Exceptions; @@ -63,7 +79,7 @@ private void initialize() { private void exec(String[] args, File currentWorkingDirectory, double startTime, - TempoMapper mapper, + TempoMap tempoMap, ArrayList parameters) { //csnd.csoundInitialize(null, null, csnd.CSOUNDINIT_NO_SIGNAL_HANDLER); @@ -139,9 +155,9 @@ private void exec(String[] args, double currentTime = 0.0f; if (startTime >= 0.0f) { - if (mapper != null) { - double renderStartSeconds = mapper.beatsToSeconds(startTime); - currentTime = mapper.secondsToBeats( + if (tempoMap != null) { + double renderStartSeconds = tempoMap.beatsToSeconds(startTime); + currentTime = tempoMap.secondsToBeats( scoreTime + renderStartSeconds); currentTime -= startTime; } else { @@ -179,7 +195,7 @@ private void exec(String[] args, public void execWait(String[] args, File currentWorkingDirectory, double startTime, - TempoMapper mapper, + TempoMap mapper, ArrayList parameters) { initialize(); exec(args, currentWorkingDirectory, startTime, mapper, parameters); diff --git a/blue-csnd6/src/main/java/blue/csnd6/render/CS6RealtimeRenderService.java b/blue-csnd6/src/main/java/blue/csnd6/render/CS6RealtimeRenderService.java index ccdbd3fe6..4e7864354 100644 --- a/blue-csnd6/src/main/java/blue/csnd6/render/CS6RealtimeRenderService.java +++ b/blue-csnd6/src/main/java/blue/csnd6/render/CS6RealtimeRenderService.java @@ -11,7 +11,6 @@ import blue.LiveData; import blue.automation.Parameter; import blue.event.PlayModeListener; -import blue.noteProcessor.TempoMapper; import blue.orchestra.blueSynthBuilder.StringChannel; import blue.services.render.CSDRenderService; import blue.services.render.CsoundBinding; @@ -21,6 +20,7 @@ import blue.settings.PlaybackSettings; import blue.settings.ProjectPropertiesUtil; import blue.soundObject.SoundObjectException; +import blue.time.TempoMap; import blue.utility.FileUtilities; import blue.utility.TextUtilities; import com.kunstmusik.csoundjni.Csound; @@ -165,7 +165,7 @@ public void play(BlueData blueData, CsdRenderResult result, runnerThread = new APIRunnerThread(blueData, csound, this, result.getParameters(), result.getStringChannels(), - result.getTempoMapper(), renderStart, bindings); + result.getTempoMap(), renderStart, bindings); notifyPlayModeListeners(PlayModeListener.PLAY_MODE_PLAY); Thread t = new Thread(runnerThread); @@ -201,7 +201,7 @@ public void render() throws SoundObjectException { RenderTimeManager timeManager = Lookup.getDefault().lookup( RenderTimeManager.class); - timeManager.setTempoMapper(result.getTempoMapper()); + timeManager.setTempoMap(result.getTempoMap()); String csd = result.getCsdText(); @@ -399,7 +399,7 @@ static class APIRunnerThread implements Runnable { private PlayModeListener playModeListener; private ArrayList parameters; private ArrayList stringChannels; - private TempoMapper mapper; + private TempoMap tempoMap; private double startTime; private BlueData blueData; private double[] valuesCache; @@ -414,7 +414,7 @@ public APIRunnerThread(BlueData blueData, PlayModeListener playModeListener, ArrayList parameters, ArrayList stringChannels, - TempoMapper mapper, + TempoMap tempoMap, double startTime, List bindings) { this.blueData = blueData; @@ -422,7 +422,7 @@ public APIRunnerThread(BlueData blueData, this.playModeListener = playModeListener; this.parameters = parameters; this.stringChannels = stringChannels; - this.mapper = mapper; + this.tempoMap = tempoMap; this.startTime = startTime; this.bindings = bindings; } @@ -468,9 +468,9 @@ public void run() { double renderStartSeconds = 0.0f; if (renderUpdatesTime) { - if (mapper != null) { - renderStartSeconds = mapper.beatsToSeconds(startTime); - currentTime = mapper.secondsToBeats( + if (tempoMap != null) { + renderStartSeconds = tempoMap.beatsToSeconds(startTime); + currentTime = tempoMap.secondsToBeats( scoreTime + renderStartSeconds); } else { currentTime = startTime + scoreTime; @@ -524,8 +524,8 @@ public void run() { if (blueData == null) { if (renderUpdatesTime) { - if (mapper != null) { - currentTime = mapper.secondsToBeats( + if (tempoMap != null) { + currentTime = tempoMap.secondsToBeats( scoreTime + renderStartSeconds); } else { currentTime = startTime + scoreTime; diff --git a/blue-services/src/main/java/blue/services/render/CSDRenderService.java b/blue-services/src/main/java/blue/services/render/CSDRenderService.java index 8f8850fdc..d3a079358 100644 --- a/blue-services/src/main/java/blue/services/render/CSDRenderService.java +++ b/blue-services/src/main/java/blue/services/render/CSDRenderService.java @@ -26,25 +26,27 @@ /** * Injectable Singleton Service for transforming a BlueData class into a * CsdRenderResult + * * @author stevenyi */ public abstract class CSDRenderService { + public static CSDRenderService getDefault() { return Lookup.getDefault().lookup(CSDRenderService.class); } - + public synchronized CsdRenderResult generateCSDForBlueLive(BlueData data, boolean useAPI) { return generateCSDForBlueLiveImpl(data, useAPI); } - + protected abstract CsdRenderResult generateCSDForBlueLiveImpl(BlueData data, boolean useAPI); - + public final synchronized CsdRenderResult generateCSD(BlueData data, double startTime, double endTime, boolean isRealTime, boolean useAPI) throws ScoreGenerationException { return generateCSDImpl(data, startTime, endTime, isRealTime, useAPI); } protected abstract CsdRenderResult generateCSDImpl(BlueData data, - double startTime, double endTime, boolean isRealTime, boolean useAPI); - - } + double startTime, double endTime, boolean isRealTime, boolean useAPI); + +} diff --git a/blue-services/src/main/java/blue/services/render/CsdRenderResult.java b/blue-services/src/main/java/blue/services/render/CsdRenderResult.java index 7a76aa9ff..e84902d0f 100644 --- a/blue-services/src/main/java/blue/services/render/CsdRenderResult.java +++ b/blue-services/src/main/java/blue/services/render/CsdRenderResult.java @@ -20,8 +20,8 @@ package blue.services.render; import blue.automation.Parameter; -import blue.noteProcessor.TempoMapper; import blue.orchestra.blueSynthBuilder.StringChannel; +import blue.time.TempoMap; import java.util.ArrayList; /** @@ -31,15 +31,15 @@ public class CsdRenderResult { private String csdText; - private TempoMapper tempoMapper; + private TempoMap tempoMap; private ArrayList parameters; private ArrayList stringChannels; - public CsdRenderResult(String csdText, TempoMapper tempoMapper, + public CsdRenderResult(String csdText, TempoMap tempoMap, ArrayList parameters, ArrayList stringChannels) { this.csdText = csdText; - this.tempoMapper = tempoMapper; + this.tempoMap = tempoMap; this.parameters = parameters; this.stringChannels = stringChannels; } @@ -56,7 +56,7 @@ public ArrayList getStringChannels() { return stringChannels; } - public TempoMapper getTempoMapper() { - return tempoMapper; + public TempoMap getTempoMap() { + return tempoMap; } } diff --git a/blue-services/src/main/java/blue/services/render/DiskRenderService.java b/blue-services/src/main/java/blue/services/render/DiskRenderService.java index 561ce0694..64ac9ee72 100644 --- a/blue-services/src/main/java/blue/services/render/DiskRenderService.java +++ b/blue-services/src/main/java/blue/services/render/DiskRenderService.java @@ -20,7 +20,7 @@ package blue.services.render; import blue.automation.Parameter; -import blue.noteProcessor.TempoMapper; +import blue.time.TempoMap; import java.io.File; import java.util.ArrayList; @@ -33,7 +33,7 @@ public interface DiskRenderService { void execWait(String[] args, File currentWorkingDirectory, double startTime, - TempoMapper mapper, + TempoMap tempoMap, ArrayList parameters); String execWaitAndCollect(String[] args, File currentWorkingDirectory); diff --git a/blue-services/src/main/java/blue/services/render/RenderTimeManager.java b/blue-services/src/main/java/blue/services/render/RenderTimeManager.java index cbfa05ff8..931da23cf 100644 --- a/blue-services/src/main/java/blue/services/render/RenderTimeManager.java +++ b/blue-services/src/main/java/blue/services/render/RenderTimeManager.java @@ -19,7 +19,7 @@ */ package blue.services.render; -import blue.noteProcessor.TempoMapper; +import blue.time.TempoMap; import java.beans.PropertyChangeListener; /** @@ -44,7 +44,7 @@ public interface RenderTimeManager { double getRenderTime(); - TempoMapper getTempoMapper(); + TempoMap getTempoMap(); void initiateRender(double renderStart); @@ -54,7 +54,7 @@ public interface RenderTimeManager { void removeRenderTimeManagerListener(RenderTimeManagerListener listener); - void setTempoMapper(TempoMapper tempoMapper); + void setTempoMap(TempoMap tempoMap); void updateTimePointer(double timePointer); diff --git a/blue-ui-core/src/main/java/blue/ui/core/render/CSDRender.java b/blue-ui-core/src/main/java/blue/ui/core/render/CSDRender.java index 098cad136..c88653cc6 100644 --- a/blue-ui-core/src/main/java/blue/ui/core/render/CSDRender.java +++ b/blue-ui-core/src/main/java/blue/ui/core/render/CSDRender.java @@ -24,7 +24,6 @@ import blue.mixer.Channel; import blue.mixer.ChannelList; import blue.mixer.Mixer; -import blue.noteProcessor.TempoMapper; import blue.orchestra.GenericInstrument; import blue.orchestra.Instrument; import blue.orchestra.blueSynthBuilder.StringChannel; @@ -39,6 +38,7 @@ import blue.soundObject.NoteList; import blue.soundObject.NoteParseException; import blue.soundObject.SoundObjectException; +import blue.time.TempoMap; import blue.udo.OpcodeList; import blue.ui.core.project.ProjectPluginManager; import blue.utility.NumberUtilities; @@ -180,15 +180,15 @@ protected synchronized CsdRenderResult generateCSDForBlueLiveImpl( score.append(""); // Tempo tempo = data.getScore().getTempo(); - TempoMapper tempoMapper = null; + TempoMap tempoMap = null; // if (tempo.isEnabled()) { -// tempoMapper = CSDRender.getTempoMapper(tempo); +// tempoMapper = CSDRender.getTempoMap(tempo); // } else { -// tempoMapper = CSDRender.getTempoMapper(globalSco); +// tempoMapper = CSDRender.getTempoMap(globalSco); // } CsdRenderResult renderResult - = new CsdRenderResult(score.toString(), tempoMapper, + = new CsdRenderResult(score.toString(), tempoMap, originalParameters, stringChannels); return renderResult; @@ -292,14 +292,14 @@ protected CsdRenderResult generateCSDImpl(BlueData data, } Tempo tempo = data.getScore().getTempo(); - TempoMapper tempoMapper = null; + TempoMap tempoMap = null; if (tempo.isEnabled()) { - tempoMapper = getTempoMapper(tempo); + tempoMap = getTempoMap(tempo); globalOrcSco.appendGlobalSco( getTempoScore(tempo, renderStartTime, endTime)); } else { - tempoMapper = getTempoMapper(globalOrcSco.getGlobalSco()); + tempoMap = getTempoMap(globalOrcSco.getGlobalSco()); } double totalDur = blue.utility.ScoreUtilities.getTotalDuration( @@ -325,7 +325,7 @@ protected CsdRenderResult generateCSDImpl(BlueData data, String globalSco = globalOrcSco.getGlobalSco() + "\n"; globalSco += arrangement.generateGlobalSco(compileData) + "\n"; globalSco = preprocessSco(globalSco, totalDur, renderStartTime, - processingStart, tempoMapper); + processingStart, tempoMap); double globalDur; try { @@ -423,7 +423,7 @@ protected CsdRenderResult generateCSDImpl(BlueData data, csd.append(""); CsdRenderResult renderResult - = new CsdRenderResult(csd.toString(), tempoMapper, + = new CsdRenderResult(csd.toString(), tempoMap, originalParameters, stringChannels); return renderResult; @@ -682,7 +682,7 @@ private void appendCsInstruments(CompileData compileData, BlueData data, private String preprocessSco(String in, double totalDur, double renderStartTime, double processingStart, - TempoMapper tempoMapper) { + TempoMap tempoMapper) { String temp = blue.utility.TextUtilities.replaceAll(in, "", Double.toString(totalDur)); @@ -692,10 +692,10 @@ private String preprocessSco(String in, double totalDur, temp = blue.utility.TextUtilities.replaceAll(temp, "", Double.toString(renderStartTime)); - TempoMapper localTempoMapper = tempoMapper; + TempoMap localTempoMap = tempoMapper; - if (localTempoMapper == null) { - localTempoMapper = getTempoMapper(in); + if (localTempoMap == null) { + localTempoMap = getTempoMap(in); } if (tempoMapper != null) { @@ -1095,7 +1095,7 @@ private void handleParametersForBlueLive(ArrayList parameters, // globalOrcSco.appendGlobalSco(paramScore.toString()); } - protected TempoMapper getTempoMapper(Tempo tempo) { + protected TempoMap getTempoMap(Tempo tempo) { StrBuilder buffer = new StrBuilder(); Line line = tempo.getLine(); for (int i = 0; i < line.size(); i++) { @@ -1105,11 +1105,11 @@ protected TempoMapper getTempoMapper(Tempo tempo) { buffer.append(" ").append(lp.getY()); } - return TempoMapper.createTempoMapper(buffer.toString()); + return TempoMap.createTempoMap(buffer.toString()); } - private TempoMapper getTempoMapper(String globalSco) { - TempoMapper mapper = null; + private TempoMap getTempoMap(String globalSco) { + TempoMap mapper = null; StringTokenizer st = new StringTokenizer(globalSco, "\n"); @@ -1117,7 +1117,7 @@ private TempoMapper getTempoMapper(String globalSco) { String temp = st.nextToken().trim(); if (temp.startsWith("t")) { - mapper = TempoMapper.createTempoMapper(temp.substring(1)); + mapper = TempoMap.createTempoMap(temp.substring(1)); } } diff --git a/blue-ui-core/src/main/java/blue/ui/core/render/CommandlineRunner.java b/blue-ui-core/src/main/java/blue/ui/core/render/CommandlineRunner.java index e9136c36a..66ffc223a 100644 --- a/blue-ui-core/src/main/java/blue/ui/core/render/CommandlineRunner.java +++ b/blue-ui-core/src/main/java/blue/ui/core/render/CommandlineRunner.java @@ -122,7 +122,7 @@ public void render() throws SoundObjectException { RenderTimeManager timeManager = Lookup.getDefault().lookup( RenderTimeManager.class); - timeManager.setTempoMapper(result.getTempoMapper()); + timeManager.setTempoMap(result.getTempoMap()); String csd = result.getCsdText(); diff --git a/blue-ui-core/src/main/java/blue/ui/core/render/ProcessConsole.java b/blue-ui-core/src/main/java/blue/ui/core/render/ProcessConsole.java index e2363034e..d8684effd 100644 --- a/blue-ui-core/src/main/java/blue/ui/core/render/ProcessConsole.java +++ b/blue-ui-core/src/main/java/blue/ui/core/render/ProcessConsole.java @@ -23,13 +23,13 @@ import blue.BlueSystem; import blue.automation.Parameter; import blue.event.PlayModeListener; -import blue.noteProcessor.TempoMapper; import blue.score.ScoreGenerationException; import blue.services.render.CSDRenderService; import blue.services.render.CsdRenderResult; import blue.services.render.DiskRenderJob; import blue.services.render.DiskRenderService; import blue.services.render.RenderTimeManager; +import blue.time.TempoMap; import blue.utility.FileUtilities; import java.awt.Color; import java.io.BufferedReader; @@ -435,7 +435,7 @@ public String getCollectedOutput() { // TODO - finish implementing! @Override - public void execWait(String[] args, File currentWorkingDirectory, double startTime, TempoMapper mapper, ArrayList parameters) { + public void execWait(String[] args, File currentWorkingDirectory, double startTime, TempoMap tempoMap, ArrayList parameters) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } diff --git a/blue-ui-core/src/main/java/blue/ui/core/render/RenderTimeManagerImpl.java b/blue-ui-core/src/main/java/blue/ui/core/render/RenderTimeManagerImpl.java index 862dff842..f36587ce8 100644 --- a/blue-ui-core/src/main/java/blue/ui/core/render/RenderTimeManagerImpl.java +++ b/blue-ui-core/src/main/java/blue/ui/core/render/RenderTimeManagerImpl.java @@ -19,7 +19,6 @@ */ package blue.ui.core.render; -import blue.noteProcessor.TempoMapper; import blue.projects.BlueProject; import blue.projects.BlueProjectManager; import blue.services.render.RenderState; @@ -27,6 +26,7 @@ import blue.services.render.RenderTimeManagerListener; import blue.settings.PlaybackSettings; import blue.soundObject.PolyObject; +import blue.time.TempoMap; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.ArrayList; @@ -50,7 +50,7 @@ public class RenderTimeManagerImpl implements RenderTimeManager { private double timePointer = 0.0f; private int timeAdjustCounter = 0; private double timeAdjust = Double.NEGATIVE_INFINITY; - private TempoMapper tempoMapper; + private TempoMap tempoMapper; private PolyObject polyObject; private final BlueProjectManager blueProjectManager; @@ -176,12 +176,12 @@ public void removePropertyChangeListener(PropertyChangeListener pcl) { } @Override - public void setTempoMapper(TempoMapper tempoMapper) { + public void setTempoMap(TempoMap tempoMapper) { this.tempoMapper = tempoMapper; } @Override - public TempoMapper getTempoMapper() { + public TempoMap getTempoMap() { return this.tempoMapper; } diff --git a/blue-ui-core/src/test/java/blue/ui/core/render/ProcessConsoleTest.java b/blue-ui-core/src/test/java/blue/ui/core/render/ProcessConsoleTest.java index f18e00d01..1241b8aeb 100644 --- a/blue-ui-core/src/test/java/blue/ui/core/render/ProcessConsoleTest.java +++ b/blue-ui-core/src/test/java/blue/ui/core/render/ProcessConsoleTest.java @@ -19,15 +19,7 @@ */ package blue.ui.core.render; -import blue.automation.Parameter; -import blue.event.PlayModeListener; -import blue.noteProcessor.TempoMapper; -import blue.services.render.DiskRenderJob; -import blue.services.render.RenderTimeManager; -import java.io.File; -import java.util.ArrayList; import org.junit.Test; -import static org.junit.Assert.*; /** *