Search in sources :

Example 26 with Note

use of blue.soundObject.Note 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)

Example 27 with Note

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

the class CybilOperator method divide.

/**
 * @param cybNoteList
 * @param startIndex
 * @param endIndex
 * @param arg
 */
private static void divide(CybilNoteList cybNoteList, int startIndex, int endIndex, CybilArg arg) {
    int pfield = cybNoteList.pfield;
    cybNoteList.index = startIndex;
    for (int i = startIndex; i < endIndex; i++) {
        Note note = cybNoteList.notes.get(i);
        double val = Double.parseDouble(note.getPField(pfield));
        val = val / arg.getValue(cybNoteList)[0];
        note.setPField(Double.toString(val), pfield);
        cybNoteList.index++;
    }
    cybNoteList.index = endIndex;
}
Also used : Note(blue.soundObject.Note)

Example 28 with Note

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

the class CybilOperator method subtract.

/**
 * @param cybNoteList
 * @param startIndex
 * @param endIndex
 * @param arg
 */
private static void subtract(CybilNoteList cybNoteList, int startIndex, int endIndex, CybilArg arg) {
    int pfield = cybNoteList.pfield;
    cybNoteList.index = startIndex;
    for (int i = startIndex; i < endIndex; i++) {
        Note note = cybNoteList.notes.get(i);
        double val = Double.parseDouble(note.getPField(pfield));
        val = val - arg.getValue(cybNoteList)[0];
        note.setPField(Double.toString(val), pfield);
        cybNoteList.index++;
    }
    cybNoteList.index = endIndex;
}
Also used : Note(blue.soundObject.Note)

Example 29 with Note

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

the class CybilOperator method add.

/**
 * @param cybNoteList
 * @param startIndex
 * @param endIndex
 * @param arg
 */
private static void add(CybilNoteList cybNoteList, int startIndex, int endIndex, CybilArg arg) {
    int pfield = cybNoteList.pfield;
    cybNoteList.index = startIndex;
    for (int i = startIndex; i < endIndex; i++) {
        Note note = cybNoteList.notes.get(i);
        double val = Double.parseDouble(note.getPField(pfield));
        val = val + arg.getValue(cybNoteList)[0];
        note.setPField(Double.toString(val), pfield);
        cybNoteList.index++;
    }
    cybNoteList.index = endIndex;
}
Also used : Note(blue.soundObject.Note)

Example 30 with Note

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

the class lo method getValue.

@Override
public double[] getValue(CybilNoteList cybilNoteList) {
    double start = getDoubleValue(args.get(0));
    double end = getDoubleValue(args.get(1));
    double diff = end / start;
    double timeValue = getTimeValue(args.get(2));
    boolean isTime = isTime(args.get(2));
    NoteList notes = cybilNoteList.notes;
    if (cybilNoteList.pfield == 2) {
        if (isTime) {
        } else {
        }
    } else {
        if (isTime) {
        } else {
            for (int i = 0; i < timeValue; i++) {
                double x = i / (timeValue - 1);
                double val = Math.pow(diff, x) * start;
                Note currentNote = notes.get(cybilNoteList.index);
                String strVal = Double.toString(val);
                currentNote.setPField(strVal, cybilNoteList.pfield);
                cybilNoteList.index++;
                if (cybilNoteList.index >= notes.size()) {
                    break;
                }
            }
        }
    }
    return null;
}
Also used : NoteList(blue.soundObject.NoteList) Note(blue.soundObject.Note)

Aggregations

Note (blue.soundObject.Note)30 NoteParseException (blue.soundObject.NoteParseException)14 NoteList (blue.soundObject.NoteList)11 Iterator (java.util.Iterator)2 Random (java.util.Random)2 Arrangement (blue.Arrangement)1 CompileData (blue.CompileData)1 GlobalOrcSco (blue.GlobalOrcSco)1 Tables (blue.Tables)1 ParameterNameManager (blue.automation.ParameterNameManager)1 LinePoint (blue.components.lines.LinePoint)1 Mixer (blue.mixer.Mixer)1 TempoMapper (blue.noteProcessor.TempoMapper)1 GenericInstrument (blue.orchestra.GenericInstrument)1 Instrument (blue.orchestra.Instrument)1 StringChannel (blue.orchestra.blueSynthBuilder.StringChannel)1 StringChannelNameManager (blue.orchestra.blueSynthBuilder.StringChannelNameManager)1 ScoreGenerationException (blue.score.ScoreGenerationException)1 ScoreObject (blue.score.ScoreObject)1 Tempo (blue.score.tempo.Tempo)1