Package com.music.model.prefs

Examples of com.music.model.prefs.UserPreferences


        meta.setTempo(tempo);

        Variation variation = getVariation(tweets, meta);
        meta.setVariation(variation);

        UserPreferences prefs = new UserPreferences();
        prefs.setTempo(tempo);
        prefs.setScale(scale);
        prefs.setVariation(variation);

        List<Piece> pieces = pieceDao.getByPreferences(prefs);
        if (pieces.isEmpty()) {
            logger.warn("No piece found for preferences " + prefs + ". Getting relaxing criteria");
            prefs.setVariation(Variation.ANY);
            pieces = pieceDao.getByPreferences(prefs);
            if (pieces.isEmpty()) {
                prefs.setTempo(Tempo.ANY);
                pieces = pieceDao.getByPreferences(prefs);
            }
        }

        Piece piece = pieces.get(random.nextInt(pieces.size()));
View Full Code Here


        Generator generator = new Generator();
        generator.configLocation = "c:/config/music";
        generator.maxConcurrentGenerations = 5;
        generator.init();

        UserPreferences prefs = new UserPreferences();
        prefs.setElectronic(Ternary.YES);
        //prefs.setSimpleMotif(Ternary.YES);
        //prefs.setMood(Mood.MAJOR);
        //prefs.setDrums(Ternary.YES);
        //prefs.setClassical(true);
        prefs.setAccompaniment(Ternary.YES);
        prefs.setElectronic(Ternary.YES);
        final ScoreContext ctx = generator.generatePiece();
        Score score = ctx.getScore();
        for (Part part : score.getPartArray()) {
            System.out.println(part.getTitle() + ": " + part.getInstrument());
        }
View Full Code Here

TOP

Related Classes of com.music.model.prefs.UserPreferences

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.