def pasbiis(self): p = cs.Score() i = cs.Score() a = cs.Score() b = cs.Score() s = cs.Score() return [p, a, s, b, i, i, s]
def paasibbis(self): p = cs.Score() i = cs.Score() a = cs.Score() b = cs.Score() s = cs.Score() return [p, a, a, s, i, b, b, i, s]
def load(self, dir): name = os.path.dirname(os.path.abspath(__name__)) joined_path = os.path.join(name, dir) data_path = os.path.normpath(joined_path) score_json = json.load(open(data_path, 'r')) form = score_json['form'] formObj = self.sctObj.create(form['name']) for i, scoreObj in enumerate(sorted(set(formObj), key = formObj.index)): self._chordProgressionObj.create(scoreObj, score_json[form['args'][i]]['ChordProgression']['name'], **score_json[form['args'][i]]['ChordProgression']['args']) self._chordProgressionObj.update(scoreObj, score_json[form['args'][i]]['ChordProgressionChild']['name']) self._melodyObj.create(scoreObj, score_json[form['args'][i]]['Melody']['name'], score_json[form['args'][i]]['Melody']['range'], **score_json[form['args'][i]]['Melody']['args']) self._melody2Obj.create(scoreObj, score_json[form['args'][i]]['Melody2']['name'], score_json[form['args'][i]]['Melody2']['range'], **score_json[form['args'][i]]['Melody2']['args']) self._drumObj.create(scoreObj, score_json[form['args'][i]]['Drums']['name']) self._bassObj.create(scoreObj, score_json[form['args'][i]]['Bass']['name'], score_json[form['args'][i]]['Bass']['range']) self._VoiceProgressionObj.create(scoreObj, score_json[form['args'][i]]['VoiceProgression']['name'], score_json[form['args'][i]]['VoiceProgression']['range'], **score_json[form['args'][i]]['VoiceProgression']['args']) self._VoiceProgression2Obj.create2(scoreObj, score_json[form['args'][i]]['VoiceProgression2']['name'], score_json[form['args'][i]]['VoiceProgression2']['range'], **score_json[form['args'][i]]['VoiceProgression2']['args']) self._effectsObj.create(scoreObj, score_json[form['args'][i]]['Effects']['name'], **score_json[form['args'][i]]['Effects']['args'] ) masterScoreObj = cs.Score() mix = score_json['mix'] mixList = self.mixObj.create(formObj, mix['name']) for j, scoreObj in enumerate(formObj): masterScoreObj.addScoreObj(scoreObj, mixList[j]) return masterScoreObj
snareScore = np.tile(self._patterns[idx].snare, len(chordProg)) kickScore = np.tile(self._patterns[idx].kick, len(chordProg)) drumObj.setHihat(hihatScore) drumObj.setSnare(snareScore) drumObj.setKick(kickScore) return drumObj def breaka(self, chordProg): drumObj = cs.Drums() score = [ -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ] hihatScore = np.tile(score, len(chordProg)) snareScore = np.tile(score, len(chordProg)) kickScore = np.tile(score, len(chordProg)) drumObj.setHihat(hihatScore) drumObj.setSnare(snareScore) drumObj.setKick(kickScore) return drumObj if __name__ == '__main__': scoreObj = cs.Score() scoreObj.setChordProg([[1, 2], [3, 4], [4, 5]]) dp = Drums() drum = dp.create(dp.random, scoreObj) print(scoreObj.drumObj.snare)
def piaabbi(self): p = cs.Score() i = cs.Score() a = cs.Score() b = cs.Score() return [p, i, a, a, b, b, i]
def paaibbi(self): p = cs.Score() i = cs.Score() a = cs.Score() b = cs.Score() return [p, a, a, i, b, b, i]
def a(self): a = cs.Score() return [a]
def ab(self): a = cs.Score() b = cs.Score() return [a, b]
def aaba(self): a = cs.Score() b = cs.Score() return [a, a, b, a]
def iaabi(self): i = cs.Score() a = cs.Score() b = cs.Score() return [i, a, a, b, i]