Search in sources :

Example 41 with NoteList

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

the class RetrogradeProcessor method main.

public static void main(String[] args) {
    NoteList n = new NoteList();
    for (int i = 0; i < 10; 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");
    RetrogradeProcessor retro = new RetrogradeProcessor();
    retro.processNotes(n);
    System.out.println("after: \n\n" + n + "\n\n");
}
Also used : NoteList(blue.soundObject.NoteList) NoteParseException(blue.soundObject.NoteParseException)

Example 42 with NoteList

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

the class SubListProcessor method processNotes.

@Override
public final void processNotes(NoteList in) throws NoteProcessorException {
    NoteList tempList = new NoteList();
    if (end < 1) {
        throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.noteListEnd"));
    }
    for (int i = 0; i < in.size(); i++) {
        if (i >= (start - 1) && i <= (end - 1)) {
            tempList.add(in.get(i));
        }
    }
    in.clear();
    in.merge(tempList);
    blue.utility.ScoreUtilities.normalizeNoteList(in);
}
Also used : NoteList(blue.soundObject.NoteList)

Example 43 with NoteList

use of blue.soundObject.NoteList 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 44 with NoteList

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

the class Field method generateNotes.

public NoteList generateNotes(final double duration, java.util.Random rnd) {
    NoteList nl = new NoteList();
    double xt = 0.0;
    int numFields = parameters.size();
    for (int i = 0; i < parameters.size(); i++) {
        getParameter(i).initialize(duration);
    }
    while (xt < duration) {
        Note n = Note.createNote(numFields);
        double p1 = getParameter(0).getValue(xt, rnd);
        p1 = p1 < 1.0 ? 1.0 : Utilities.round(p1, 0);
        n.setPField(NumberUtilities.formatDouble(p1), 1);
        n.setPField(NumberUtilities.formatDouble(xt), 2);
        for (int i = 3; i < numFields + 1; i++) {
            double val = getParameter(i - 1).getValue(xt, rnd);
            if (i == 3 && val < 0) {
                n.setPField(NumberUtilities.formatDouble(-val), i);
                n.setTied(true);
            } else {
                n.setPField(NumberUtilities.formatDouble(val), i);
            }
        }
        double p2 = getParameter(1).getValue(xt, rnd);
        if (p2 == 0.0) {
            System.err.println("[JMask] - WARNING: p2 = 0 !");
        }
        xt += p2;
        nl.add(n);
    }
    return nl;
}
Also used : NoteList(blue.soundObject.NoteList) Note(blue.soundObject.Note)

Example 45 with NoteList

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

the class BlueLiveTopComponent method triggerLiveObject.

protected void triggerLiveObject(LiveObject liveObject) {
    NoteList nl = null;
    try {
        SoundObject sObj = liveObject.getSoundObject();
        if (sObj.getTimeBehavior() != SoundObject.TIME_BEHAVIOR_NOT_SUPPORTED) {
            sObj.setTimeBehavior(SoundObject.TIME_BEHAVIOR_NONE);
        }
        nl = sObj.generateForCSD(compileData, 0.0f, -1.0f);
    } catch (Exception e) {
        Exceptions.printStackTrace(e);
    }
    if (nl == null) {
        return;
    }
    int tempo = (Integer) tempoSpinner.getValue();
    ScoreUtilities.scaleScore(nl, 60.0f / tempo);
    String scoreText = nl.toString();
    if (scoreText != null && scoreText.length() > 0) {
        RealtimeRenderManager.getInstance().passToStdin(scoreText);
    }
}
Also used : NoteList(blue.soundObject.NoteList) SoundObject(blue.soundObject.SoundObject) BadLocationException(javax.swing.text.BadLocationException)

Aggregations

NoteList (blue.soundObject.NoteList)50 NoteParseException (blue.soundObject.NoteParseException)25 Note (blue.soundObject.Note)11 CompileData (blue.CompileData)6 SoundObject (blue.soundObject.SoundObject)6 GenericScore (blue.soundObject.GenericScore)4 Arrangement (blue.Arrangement)3 GlobalOrcSco (blue.GlobalOrcSco)3 Tables (blue.Tables)3 NoteProcessorException (blue.noteProcessor.NoteProcessorException)3 SoundObjectException (blue.soundObject.SoundObjectException)3 OpcodeList (blue.udo.OpcodeList)3 ParameterNameManager (blue.automation.ParameterNameManager)2 LiveObject (blue.blueLive.LiveObject)2 LiveObjectSet (blue.blueLive.LiveObjectSet)2 LinePoint (blue.components.lines.LinePoint)2 Mixer (blue.mixer.Mixer)2 TempoMapper (blue.noteProcessor.TempoMapper)2 GenericInstrument (blue.orchestra.GenericInstrument)2 Instrument (blue.orchestra.Instrument)2