Hi Hwaen Ch'uqi,
Far from being perfect but it's a start:
\version "2.19.35"
compressPercent =
#(define-music-function (repeats notes) (integer? ly:music?)
#{
\tag Orch {
%% Optional:
%\set countPercentRepeats = ##t
\repeat percent #repeats \absolute { #notes }
}
\tag Solo {
\repeat percent 2 {
\set countPercentRepeats = ##t
\override PercentRepeatCounter.stencil = #(lambda (grob)
(grob-interpret-markup grob
(markup #:concat
( ;; Optional:
#:fontsize -3 "x"
(number->string repeats)))))
#notes
\applyContext #(lambda (c)
(set! (ly:context-property
(ly:context-find c 'Timing)
'currentBarNumber)
(+ (- repeats 2) (ly:context-property c 'currentBarNumber))))
}
}
#})
soloInstrumentOne = \relative {
c' c c c
\compressPercent 8 \relative { c''4 c c c }
\break
c4 c c c
\bar "|."
}
soloInstrumentTwo = \relative {
\repeat unfold 10 { c''4 c c c }
}
%%% Orchestral score %%%
\score {
\new StaffGroup <<
\new Staff
\with { instrumentName = "Inst 1" }
\keepWithTag Orch\soloInstrumentOne
\new Staff
\with { instrumentName = "Inst 2" }
\soloInstrumentTwo
>>
}
%%% Solo score %%%
\score {
\new Staff
\with { instrumentName = "Inst 1" }
\keepWithTag Solo\soloInstrumentOne
}