void IT_ProcessEnvelopePit(ITNode node, INSTRUMENT d) { if ((node.flg & 1) != 0) { d.pitflg |= SharpMikCommon.EF_ON; } if ((node.flg & 2) != 0) { d.pitflg |= SharpMikCommon.EF_LOOP; } if ((node.flg & 4) != 0) { d.pitflg |= SharpMikCommon.EF_SUSTAIN; } d.pitpts = node.pts; d.pitbeg = node.beg; d.pitend = node.end; d.pitsusbeg = node.susbeg; d.pitsusend = node.susend; for (int u = 0; u < node.pts; u++) { d.pitenv[u].pos = (short)node.tick[u]; } if ((d.pitflg & SharpMikCommon.EF_ON) != 0 && (d.pitpts < 2)) { int flag = d.pitflg; flag &= ~SharpMikCommon.EF_ON; d.pitflg = (byte)flag; } }
private void SearchOverlap(ITNode n, IRange r) { // search in left subtree first, so that results are sorted if (n != null) { if (n.Max >= r.Start) { if (n.Left != null) { SearchOverlap(n.Left as ITNode, r); } foreach (T q in n.Values) { if (RangesOverlap(q, r)) { searchResults.Add(q); } } } if (n.Key <= r.End && n.Right != null) { SearchOverlap(n.Right as ITNode, r); } } }
public void Delete(T r) { ITNode n = (this.SearchNode(r.Start) as ITNode); if (n == null) { return; } n.Values.Remove(r); if (n.Values.Count == 0) { this.Delete(r.Start); } }
void IT_LoadEnvelope(ITNode node, bool signed) { node.flg = m_Reader.Read_byte(); node.pts = m_Reader.Read_byte(); node.beg = m_Reader.Read_byte(); node.end = m_Reader.Read_byte(); node.susbeg = m_Reader.Read_byte(); node.susend = m_Reader.Read_byte(); for (int lp = 0; lp < ITENVCNT; lp++) { if (!signed) { node.node[lp] = m_Reader.Read_byte(); } else { node.node[lp] = (byte)m_Reader.Read_sbyte(); } node.tick[lp] = m_Reader.Read_Intel_ushort(); } m_Reader.Read_byte(); }
public ITINSTHEADER() { vol = new ITNode(); pan = new ITNode(); pit = new ITNode(); }