Search in sources :

Example 26 with NoteParseException

use of blue.soundObject.NoteParseException in project blue by kunstmusik.

the class TuningProcessor method main.

public static void main(String[] args) {
    NoteList n = new NoteList();
    for (int i = 0; i < 30; i++) {
        try {
            n.add(Note.createNote("i1 " + i + " " + i + " 6." + i + " 4"));
        } catch (NoteParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    System.out.println("before: \n\n" + n + "\n\n");
    TuningProcessor tp = new TuningProcessor();
    tp.setPfield("4");
    try {
        tp.processNotes(n);
    } catch (NoteProcessorException ex) {
        System.out.println("Exception: " + ex.getMessage());
    }
    System.out.println("after: \n\n" + n + "\n\n");
}
Also used : NoteList(blue.soundObject.NoteList) NoteParseException(blue.soundObject.NoteParseException)

Example 27 with NoteParseException

use of blue.soundObject.NoteParseException in project blue by kunstmusik.

the class CSDRender method handleParametersForBlueLive.

private void handleParametersForBlueLive(ArrayList parameters, ArrayList<StringChannel> stringChannels, GlobalOrcSco globalOrcSco, NoteList notes, Arrangement arrangement, boolean useAPI) {
    Object[] varNum = new Object[1];
    StrBuilder initStatements = new StrBuilder();
    StrBuilder paramScore = new StrBuilder();
    for (StringChannel strChannel : stringChannels) {
        String varName = strChannel.getChannelName();
        initStatements.append(varName);
        initStatements.append(" = ");
        initStatements.append("\"").append(strChannel.getValue()).append("\"\n");
        if (useAPI) {
            initStatements.append(varName).append(" chnexport \"");
            initStatements.append(varName).append("\", 3\n");
        }
    }
    for (int i = 0; i < parameters.size(); i++) {
        Parameter param = (Parameter) parameters.get(i);
        varNum[0] = new Integer(i);
        String varName = param.getCompilationVarName();
        // param.setCompilationVarName(varName);
        double initialVal = param.getFixedValue();
        // init statements
        initStatements.append(varName);
        initStatements.append(" init ");
        initStatements.append(NumberUtilities.formatDouble(initialVal));
        initStatements.append("\n");
        if (useAPI) {
            initStatements.append(varName).append(" chnexport \"");
            initStatements.append(varName).append("\", 3\n");
        }
    }
    globalOrcSco.appendGlobalOrc(initStatements.toString());
    try {
        notes.addAll(ScoreUtilities.getNotes(paramScore.toString()));
    } catch (NoteParseException ex) {
        ex.printStackTrace();
    }
// globalOrcSco.appendGlobalSco(paramScore.toString());
}
Also used : NoteParseException(blue.soundObject.NoteParseException) StringChannel(blue.orchestra.blueSynthBuilder.StringChannel) Parameter(blue.automation.Parameter) StrBuilder(org.apache.commons.lang3.text.StrBuilder) LinePoint(blue.components.lines.LinePoint)

Example 28 with NoteParseException

use of blue.soundObject.NoteParseException in project blue by kunstmusik.

the class CommandlineRunner method passToStdin.

@Override
public void passToStdin(String text) {
    NoteList nl = null;
    try {
        nl = ScoreUtilities.getNotes(text);
    } catch (NoteParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        nl = null;
    }
    if (nl == null) {
        return;
    }
    for (Iterator iter = nl.iterator(); iter.hasNext(); ) {
        Note note = (Note) iter.next();
        console.passToStdin(note.toString());
    }
}
Also used : NoteList(blue.soundObject.NoteList) NoteParseException(blue.soundObject.NoteParseException) Note(blue.soundObject.Note) Iterator(java.util.Iterator)

Aggregations

NoteParseException (blue.soundObject.NoteParseException)28 NoteList (blue.soundObject.NoteList)24 LinePoint (blue.components.lines.LinePoint)3 StringChannel (blue.orchestra.blueSynthBuilder.StringChannel)3 Note (blue.soundObject.Note)3 SoundObjectException (blue.soundObject.SoundObjectException)3 StrBuilder (org.apache.commons.lang3.text.StrBuilder)3 Parameter (blue.automation.Parameter)2 GenericInstrument (blue.orchestra.GenericInstrument)2 File (java.io.File)2 Arrangement (blue.Arrangement)1 BlueData (blue.BlueData)1 CompileData (blue.CompileData)1 GlobalOrcSco (blue.GlobalOrcSco)1 Tables (blue.Tables)1 ParameterNameManager (blue.automation.ParameterNameManager)1 Mixer (blue.mixer.Mixer)1 NoteProcessorException (blue.noteProcessor.NoteProcessorException)1 TempoMapper (blue.noteProcessor.TempoMapper)1 Instrument (blue.orchestra.Instrument)1