We consider the problem of determining the multiplicity function m ⊗ p ω ξ in the tensor power decomposition of a module of a semisimple algebra g into irreducible submodules. For this, we propose to pass to the corresponding decomposition of a singular element Ψ((L ω g ) ⊗p ) of the module tensor power into singular elements of irreducible submodules and formulate the problem of determining the function M ⊗ p ω ξ . This function satisfies a system of recurrence relations that corresponds to the procedure for multiplying modules. To solve this problem, we introduce a special combinatorial object, a generalized (g, ω) pyramid, i.e., a set of numbers (p, {mi})g,ω satisfying the same system of recurrence relations. We prove that M ⊗ p ω ξ can be represented as a linear combination of the corresponding (p, {mi})g,ω. We illustrate the obtained solution with several examples of modules of the algebras sl(3) and so(5).