diff --git a/include/pattern.h b/include/pattern.h
index 4f8b995..4ecad20 100644
--- a/include/pattern.h
+++ b/include/pattern.h
@@ -76,6 +76,8 @@ public:
 						const bool _quant_pos = true );
 	void rearrangeAllNotes();
 	void clearNotes();
+	
+	void clearMarked();
 
 	inline const NoteVector & notes() const
 	{
@@ -128,6 +130,16 @@ public:
 	void addSteps( int _n );
 	void removeSteps( int _n );
 
+	inline QList<int> markedSemiTonesOfPattern() const
+	{
+		return m_markedSemiTonesOfPattern;
+	}
+	
+	inline void SetmarkedSemiTonesOfPattern(QList<int> in)
+	{
+		m_markedSemiTonesOfPattern = in;
+	}
+	
 	virtual trackContentObjectView * createView( trackView * _tv );
 
 
@@ -151,10 +163,11 @@ private:
 	InstrumentTrack * m_instrumentTrack;
 
 	PatternTypes m_patternType;
-
+	
 	// data-stuff
 	NoteVector m_notes;
 	int m_steps;
+	QList<int> m_markedSemiTonesOfPattern;
 
 	// pattern freezing
 	sampleBuffer * m_frozenPattern;

diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp
index e94c022..aea7774 100644
--- a/src/gui/piano_roll.cpp
+++ b/src/gui/piano_roll.cpp
@@ -686,6 +686,7 @@ void pianoRoll::markSemiTone( int i )
 	qSort( m_markedSemiTones.begin(), m_markedSemiTones.end(), qGreater<int>() );
 	QList<int>::iterator new_end = std::unique( m_markedSemiTones.begin(), m_markedSemiTones.end() );
 	m_markedSemiTones.erase( new_end, m_markedSemiTones.end() );
+	m_pattern->SetmarkedSemiTonesOfPattern(m_markedSemiTones);
 }
 
 
@@ -742,6 +743,10 @@ void pianoRoll::setCurrentPattern( pattern * _new_pattern )
 						NumOctaves * KeysPerOctave );
 		}
 	}
+	
+	if(!m_pattern->markedSemiTonesOfPattern().empty())
+	m_markedSemiTones = m_pattern->markedSemiTonesOfPattern();
+	
 	// resizeEvent() does the rest for us (scrolling, range-checking
 	// of start-notes and so on...)
 	resizeEvent( NULL );

 
diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp
index 67f07fb..b3f0778 100644
--- a/src/tracks/pattern.cpp
+++ b/src/tracks/pattern.cpp
@@ -289,7 +289,12 @@ void pattern::clearNotes()
 	emit dataChanged();
 }
 
-
+void pattern::clearMarked()
+{
+	m_markedSemiTonesOfPattern.clear();
+	
+	emit dataChanged();
+}
 
 
 void pattern::setStep( int _step, bool _enabled )
@@ -359,7 +364,7 @@ void pattern::saveSettings( QDomDocument & _doc, QDomElement & _this )
 	_this.setAttribute( "muted", isMuted() );
 	_this.setAttribute( "steps", m_steps );
 	_this.setAttribute( "frozen", m_frozenPattern != NULL );
-
+	
 	// now save settings of all notes
 	for( NoteVector::Iterator it = m_notes.begin();
 						it != m_notes.end(); ++it )
@@ -369,6 +374,16 @@ void pattern::saveSettings( QDomDocument & _doc, QDomElement & _this )
 			( *it )->saveState( _doc, _this );
 		}
 	}
+	
+	// save settings of m_markedSemiTonesOfPattern
+	for( QList<int>::Iterator it = m_markedSemiTonesOfPattern.begin();
+						it != m_markedSemiTonesOfPattern.end(); ++it )
+	{
+		QDomElement nodemarked = _doc.createElement( "nodemarked" );	
+		_this.appendChild(nodemarked);	
+		nodemarked.setAttribute("marked", *it);
+	}	
+	
 }
 
 
@@ -392,19 +407,25 @@ void pattern::loadSettings( const QDomElement & _this )
 	}
 
 	clearNotes();
-
-	QDomNode node = _this.firstChild();
-	while( !node.isNull() )
-	{
-		if( node.isElement() &&
-			!node.toElement().attribute( "metadata" ).toInt() )
-		{
-			note * n = new note;
-			n->restoreState( node.toElement() );
-			m_notes.push_back( n );
-		}
-		node = node.nextSibling();
-        }
+	clearMarked();
+	
+	QDomNodeList nodenotes = _this.elementsByTagName( "note" );
+	QDomNodeList nodemarked = _this.elementsByTagName( "nodemarked" );
+	
+	int num = nodenotes.length();
+	for(int i=0; i<num;i++)
+	{
+	note * n = new note;
+	n->restoreState( nodenotes.item(i).toElement() );
+	m_notes.push_back( n );
+	}
+	
+	int num2 = nodemarked.length();
+	for(int i=0; i<num2;i++)
+	{
+	int m = nodemarked.item(i).toElement().attribute( "marked").toInt();
+	m_markedSemiTonesOfPattern.push_back( m );
+	}	
 
 	m_steps = _this.attribute( "steps" ).toInt();
 	if( m_steps == 0 )
