22 void mix(int16_t *out,
size_t samples);
35 Instr* parent=
nullptr;
39 int64_t nextOn =std::numeric_limits<int64_t>::max();
40 int64_t nextOff=std::numeric_limits<int64_t>::max();
42 bool isValid()
const {
return !(nextOn==std::numeric_limits<int64_t>::max() && nextOn==nextOff && samples==0); }
46 PatternList::InsInternal* ptr=
nullptr;
49 std::shared_ptr<PatternList::PatternInternal> pattern;
52 using PatternInternal = PatternList::PatternInternal;
54 Step stepInc (PatternInternal &pptn, int64_t b, int64_t e, int64_t samplesRemain);
55 void stepApply(std::shared_ptr<PatternList::PatternInternal> &pptn,
const Step& s, int64_t b);
56 void implMix (PatternList::PatternInternal &pptn,
float volume, int16_t *out,
size_t cnt);
58 int64_t nextNoteOn (PatternInternal &part, int64_t b, int64_t e);
59 int64_t nextNoteOff(int64_t b, int64_t e);
61 void noteOn (std::shared_ptr<PatternInternal> &pattern, PatternList::Note *r);
62 void noteOn (std::shared_ptr<PatternInternal> &pattern, int64_t time);
63 void noteOff(int64_t time);
64 std::shared_ptr<PatternInternal> checkPattern(std::shared_ptr<PatternInternal> p);
68 bool hasVolumeCurves(PatternInternal &part, Instr &ins)
const;
69 void volFromCurve(PatternInternal &part, Instr &ins, std::vector<float> &v);
72 bool checkVariation(
const T& item)
const;
73 int getGroove()
const;
75 std::shared_ptr<Music::Internal> current=
nullptr;
76 std::shared_ptr<Music::Internal> nextMus=
nullptr;
78 int64_t sampleCursor=0;
80 std::shared_ptr<PatternInternal> pattern=
nullptr;
83 std::atomic<uint32_t> variationCounter={};
84 std::atomic<size_t> grooveCounter={};
86 std::atomic<float> volume={1.f};
87 std::vector<Active> active;
88 std::list<Instr> uniqInstr;
89 std::vector<float> pcm, vol, pcmMix;