Let $M$ be a (left) module over a not necessarily commutative algebra $A$. We can say that $M$ is projective if, for some $n \in \mathbb{N}$,
i) there exists a projection $P$ (i.e. $P \in M_n(A)$ and $P^2 = P$) such that $$ P(A^n) = M, $$
OR EQUIVALENTLY
ii) if we have a dual basis, that is to say, a set $\{m_{i}\in M \mid i = 1, \dots,n\}$, and a set $\{f_{i} \in \mathrm {Hom}(M,A)\mid i = 1, \dots,n\}$ such that for every $x \in M$, $$ x = \sum_{i = 1}^n f_{i}(x)m_{i}. $$
What I would like to know is: Given the dual basis, how can one construct the projection $P$?
The definitions given in the question are for finitely generated projective modules (although they can both be adapted for arbitrary projectives).
Given the dual basis, there are module homomorphisms $f:M\to A^n$ given by $$f(x)=(f_1(x),\dots,f_n(x)),$$ and $g:A^n\to M$ given by $$g(a_1,\dots,a_n)=a_1m_1+\dots+a_nm_n.$$
The definition of a dual basis gives that $g\circ f=\text{id}_M$, so $f$ is a split monomorphism and $f\circ g:A^n\to A^n$ is an idempotent endomorphism of $A^n$ with image isomorphic to $M$.
So the projection you want is just $P=f\circ g$, or in other words $$P(a_1,\dots,a_n)=(f_1(a_1m_1+\dots+a_nm_n),\dots,f_n(a_1m_1+\dots+a_nm_n)).$$