Returns the rendition object (JNote, JChord...) for
the given music element reference
973880
public JScoreElement getRenditionObjectFor(MusicElementReference ref) {
		//fast way
		JScoreElement jse = (JScoreElement) m_scoreElements.get(ref);
		if (jse == null) {
			//if null, search comparing ref with all keys
			//System.out.println("Can't find "+ref+", compare keys");
			Enumeration e = m_scoreElements.keys();
			while (e.hasMoreElements()) {
				MusicElementReference mer = (MusicElementReference) e.nextElement();
				if (ref.equals(mer)) {
					jse = (JScoreElement) m_scoreElements.get(mer);
					//System.out.println("found!");
					break;
				}
			}
		}
		return jse;
	}
983012
static private void transpose_Chord(DecorableElement transp,
			Note noneTranspKeyNote, KeySignature noneTranspKey,
			Note lastKeyNote, KeySignature lastKey) {
		Chord chord = transp.getChord();
		if (chord != null) {
			if (chord.hasNote())
				chord.setNote((Note) transpose_Note(chord.getNote(),
						noneTranspKeyNote, null, lastKeyNote, null));
			if (chord.hasBass())
				chord.setBass((Note) transpose_Note(chord.getBass(),
						noneTranspKeyNote, null, lastKeyNote, null));
		}
	}
420959
def _private_notes(self, key, value):
    
    def _is_for_cds(value):
        normalized_c_values = [el.upper() for el in force_list(value.get('c'))]
        return 'CDS' in normalized_c_values

    def _is_for_hal(value):
        normalized_c_values = [el.upper() for el in force_list(value.get('c'))]
        return 'HAL' in normalized_c_values

    def _is_not_for_hal(value):
        normalized_c_values = [el.upper() for el in force_list(value.get('c'))]
        return 'NOT HAL' in normalized_c_values

    _private_notes = self.get('_private_notes', [])
    _export_to = self.get('_export_to', {})

    for value in force_list(value):
        if _is_for_cds(value):
            _export_to['CDS'] = True

        if _is_for_hal(value):
            _export_to['HAL'] = True
        elif _is_not_for_hal(value):
            _export_to['HAL'] = False

        source = force_single_element(value.get('9'))
        for _private_note in force_list(value.get('a')):
            _private_notes.append({
                'source': source,
                'value': _private_note,
            })

    self['_export_to'] = _export_to
    return _private_notes
665944
def notes_get(id)
      options = create_params({})
      note = self.class.get("/notes/#{id}", options)['note']

      return nil unless note

      # Complete hack, because the API is still broken
      content = '__content__'
      Note.new({
        id:      note['id'],
        # Remove whitespace around the title,
        # because of missing xml tag around
        title:   note[content].gsub(/\n|  +/, ''),
        length:  note['length'][content].to_i,
        text:    note['text'][content]
      })
    end
120489
public void setMiddleNote(Note n) {
		//same note has middle, maybe with octave
		byte strictHeight = n.getStrictHeight();
		boolean set = false;
		if (strictHeight == getMiddleNote().getStrictHeight()) {
			set = true;
		} else {
			//some accepted cases
			Clef[] toCompare = null;
			if (isG()) {
				toCompare = new Clef[] { TREBLE, FRENCH_VIOLIN };
			} else if (isF()) {
				toCompare = new Clef[] { BASS, BARITONE };
			} else if (isC()) {
				toCompare = new Clef[] { SOPRANO, MEZZOSOPRANO, ALTO, TENOR };
			}
			if (toCompare != null) {
                for (Clef aToCompare : toCompare) {
                    if (strictHeight == aToCompare.getMiddleNote().getStrictHeight()) {
                        m_lineNumber = (byte) aToCompare.getLineNumber();
                        set = true;
                        break;
                    }
                }
			}
			//Accept any note as middle
			if (isPerc()) {
				set = true;
			}
		}
		if (set) {
			//if linenumber has changed, recompute middle note
			reset();
			//compute invisible octave transposition
			m_invisibleOctaveTransp =
				(byte)(n.getOctaveTransposition()
					- getMiddleNote().getOctaveTransposition());
			m_middleNote = n;
			reset();
		}
	}
275088
private static byte[] instrumentClassFile(byte[] classfileBuffer) {
        String className = new ClassReader(classfileBuffer).getClassName().replace("/", ".");
        ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
        byte[] newClassfileBuffer = new EkstaziCFT().transform(currentClassLoader, className, null, null, classfileBuffer);
        return newClassfileBuffer;
    }
318150
function getNotesUp($scalenum, $root, $octaves, $hand) {
        $initialnote = clone($root);
        $str = "\n % going up \n";
        $clef = ''; // this will force a clef to be defined for the first note
        for ($o=0; $o<$octaves; $o++) {
            $scale = new Scale($scalenum, $initialnote, 'ascending');
            $pitches = $scale->getPitches();
            $degree = 0;
            foreach ($pitches as $pitch) {
                $newclef = ($initialnote->interval($this->middleC) > 0) ? 'bass' : 'treble';
                if ($newclef != $clef) {
                    $clef = $newclef;
                    $str .= '\\clef "' . $clef . '" ';
                }
                $str .= $pitch->toLilypond() . $this->duration;

                $isbottom = $pitch->isEnharmonic($root);
                $finger = $this->getFinger($scalenum, $initialnote, $hand, $degree, false, $isbottom);
                $str .= '-' . $finger;

                $str .= ' ';
                $degree++;
            }
            $initialnote->transpose(12);
        }
        return $str;
    }
372540
def release_note(version = Origen.app.version.prefixed)
      version = VersionString.new(version)
      version = version.prefixed if version.semantic?
      capture = false
      note_started = false
      note = []
      File.readlines("#{Origen.root}/doc/history").each do |line|
        line = line.strip
        if capture
          if note_started
            if line =~ /^<a class="anchor release_tag/ || line =~ /^#+ Tag/
              note.pop while note.last && note.last.empty?
              return note
            end
            if line.empty? && note.empty?
              # Don't capture preceding blank lines
            else
              note << line
            end
          elsif line =~ /^#+ by/
            note_started = true
          end
        else
          if line =~ /Tag:/
            line = line.gsub('\\', '')
            if line =~ /^#+ Tag: #{version}$/ ||
               line =~ />Tag: #{version}</
              capture = true
            end
          end
        end
      end
      note.pop while note.last && note.last.empty?
      note
    end
884929
protected JChord createNormalizedChord(MultiNote mNote, ScoreMetrics mtrx, Point2D base) {
		return new JChord(mNote, getClef(), mtrx, base);
	}
1206211
public static String getFilename(@NotNull Rendition rendition) {
    boolean isOriginal = isOriginal(rendition);
    if (isOriginal) {
      return rendition.getAsset().getName();
    }
    else {
      return rendition.getName();
    }
  }
1315341
protected void transformDetailBand() {
        log.debug("transforming Detail Band...");

        JRDesignSection detailSection = (JRDesignSection) design.getDetailSection();

        //TODO: With this new way, we can use template content as it comes, and add a new band for DJ on top or bellow it.
        JRDesignBand detail;
        if (detailSection.getBandsList().isEmpty()) {
            detail = new JRDesignBand();
            detailSection.getBandsList().add(detail);
        } else {
            detail = (JRDesignBand) detailSection.getBandsList().iterator().next();
        }

        detail.setHeight(report.getOptions().getDetailHeight());

        for (AbstractColumn column : getVisibleColumns()) {

            /*
              Barcode column
             */
            if (column instanceof BarCodeColumn) {
                BarCodeColumn barcodeColumn = (BarCodeColumn) column;
                JRDesignImage image = new JRDesignImage(new JRDesignStyle().getDefaultStyleProvider());
                JRDesignExpression imageExp = new JRDesignExpression();
//				imageExp.setText("ar.com.fdvs.dj.core.BarcodeHelper.getBarcodeImage("+barcodeColumn.getBarcodeType() + ", "+ column.getTextForExpression()+ ", "+ barcodeColumn.isShowText() + ", " + barcodeColumn.isCheckSum() + ", " + barcodeColumn.getApplicationIdentifier() + ","+ column.getWidth() +", "+ report.getOptions().getDetailHeight().intValue() + " )" );

                //Do not pass column height and width mecause barbecue
                //generates the image with wierd dimensions. Pass 0 in both cases
                String applicationIdentifier = barcodeColumn.getApplicationIdentifier();
                if (applicationIdentifier != null && !"".equals(applicationIdentifier.trim())) {
                    applicationIdentifier = "$F{" + applicationIdentifier + "}";
                } else {
                    applicationIdentifier = "\"\"";
                }
                imageExp.setText("ar.com.fdvs.dj.core.BarcodeHelper.getBarcodeImage(" + barcodeColumn.getBarcodeType() + ", " + column.getTextForExpression() + ", " + barcodeColumn.isShowText() + ", " + barcodeColumn.isCheckSum() + ", " + applicationIdentifier + ",0,0 )");


                imageExp.setValueClass(Image.class);
                image.setExpression(imageExp);
                image.setHeight(getReport().getOptions().getDetailHeight());
                image.setWidth(column.getWidth());
                image.setX(column.getPosX());
                image.setScaleImage(ScaleImageEnum.getByValue(barcodeColumn.getScaleMode().getValue()));

                image.setOnErrorType(OnErrorTypeEnum.ICON); //FIXME should we provide control of this to the user?

                if (column.getLink() != null) {
                    String name = "column_" + getReport().getColumns().indexOf(column);
                    HyperLinkUtil.applyHyperLinkToElement((DynamicJasperDesign) getDesign(), column.getLink(), image, name);
                }

                applyStyleToElement(column.getStyle(), image);

                detail.addElement(image);
            }
            /*
              Image columns
             */
            else if (column instanceof ImageColumn) {
                ImageColumn imageColumn = (ImageColumn) column;
                JRDesignImage image = new JRDesignImage(new JRDesignStyle().getDefaultStyleProvider());
                JRDesignExpression imageExp = new JRDesignExpression();
                imageExp.setText(column.getTextForExpression());

                imageExp.setValueClassName(imageColumn.getValueClassNameForExpression());
                image.setExpression(imageExp);
                image.setHeight(getReport().getOptions().getDetailHeight());
                image.setWidth(column.getWidth());
                image.setX(column.getPosX());
                image.setScaleImage(ScaleImageEnum.getByValue(imageColumn.getScaleMode().getValue()));

                applyStyleToElement(column.getStyle(), image);

                if (column.getLink() != null) {
                    String name = "column_" + getReport().getColumns().indexOf(column);
                    HyperLinkUtil.applyHyperLinkToElement((DynamicJasperDesign) getDesign(), column.getLink(), image, name);
                }

                detail.addElement(image);
            }
            /*
              Regular Column
             */
            else {
                if (getReport().getOptions().isShowDetailBand()) {
                    JRDesignTextField textField = generateTextFieldFromColumn(column, getReport().getOptions().getDetailHeight(), null);

                    if (column.getLink() != null) {
                        String name = getDesign().getName() + "_column_" + getReport().getColumns().indexOf(column);
                        HyperLinkUtil.applyHyperLinkToElement((DynamicJasperDesign) getDesign(), column.getLink(), textField, name);
                    }

                    transformDetailBandTextField(column, textField);

                    if (textField.getExpression() != null)
                        detail.addElement(textField);
                }

            }

        }
    }
986438
def notes(element_key)
      parameter = { basic_auth: @auth }

      response = self.class.get("/elements/#{element_key}/notes", parameter)
      if response.success?
        search_response_header = SearchResponseHeader.new(response)
        search_response_header.elementList
      end
    end
484566
function (key, ch) {
  key = note.create(key || 'C');
  ch = chord.create(ch);

  return new Mehegan(getNumeral(key, ch.root), getQuality(ch));
}
1343681
@SuppressWarnings("static-method")
	public String findStringValue(JvmAnnotationReference reference) {
		assert reference != null;
		for (final JvmAnnotationValue value : reference.getValues()) {
			if (value instanceof JvmStringAnnotationValue) {
				for (final String strValue : ((JvmStringAnnotationValue) value).getValues()) {
					if (strValue != null) {
						return strValue;
					}
				}
			}
		}
		return null;
	}
1095421
def note_adapter(obj, request):
    '''
    
    '''
    return {
        'note': obj.note,
        'type': obj.type,
        'language': obj.language,
        'markup': obj.markup
    }
101607
function(tune) {
  var ret = {
    attributes: {
      divisions: 1 /tune.getBeatLength(),
      clef: {
        line: 2
      },
      key: {},
      time: {}
    }
  };
  var measures = [];
  var measureCounter = 0;
  var barlineCounter = 0;

  // parse lines
  for (var l = 0; l < tune.lines.length; l++) {
    for (var s = 0; s < tune.lines[l].staff.length; s++) {
      var staff = tune.lines[l].staff[s];

      // parse default clef, key, meter
      if (l === 0 && s === 0) {
        ret.attributes.clef.sign = getKeyByValue(clefs, staff.clef.type);
        ret.attributes.clef.line = staff.clef.clefPos / 2;
        ret.attributes.key.fifths = parseInt(getKeyByValue(circleOfFifths, staff.key.root));
        ret.attributes.time.beats = staff.meter.value[0].num;
        ret.attributes.time['beat-type'] = staff.meter.value[0].den;
      }

      for (var v = 0; v < staff.voices.length; v++) {
        for (var t = 0; t < staff.voices[v].length; t++) {
          var token = staff.voices[v][t];

          // init measure if none exists
          if (measures[measureCounter] === undefined) {
            measures[measureCounter] = new Measure();
          }

          switch (token.el_type) {
            case "note":
              measures[measureCounter].addNote(token, ret.attributes.divisions, ret.attributes.time['beat-type']);
              break;
            case "bar":
              if (token.type === 'bar_right_repeat') {
                measures[measureCounter].setRepeatRight();
              }
              measureCounter++;
              if (measures[measureCounter] === undefined) {
                measures[measureCounter] = new Measure();
              }
              if (token.type === 'bar_left_repeat') {
                measures[measureCounter].setRepeatLeft();
              }
              break;
            default:
              console.log(token);
              break;
          }
        }
      }
    }
  }

  // put measures together
  ret.measures = [];
  for (var i = 0; i < measures.length; i++) {
    var measure = measures[i].get();
    if (measure.notes.length > 0) {
      ret.measures.push(measure);
    }
  }
  return ret;
}
287320
public MultiNote[] normalize() {
	  Hashtable splitter = new Hashtable();
	  for (int i=0; i<m_notes.size(); i++) {
		  Note note = (Note)m_notes.elementAt(i);
		  Short key = note.getStrictDuration();
		  if (splitter.containsKey(key))
			  ((Vector)splitter.get(key)).addElement(note);
		  else {
			  Vector v = new Vector();
			  v.addElement(note);
			  splitter.put(key, v);
		  }
	  }
	  short[] strictDurations = getStrictDurations();
	  MultiNote[] normalizedChords = new MultiNote[strictDurations.length];
	  for (int i=0; i<strictDurations.length;i++) {
		  normalizedChords[i] = new MultiNote((Vector)splitter.get(new Short(strictDurations[i])));
	  }
	  return normalizedChords;
  }