The application of piezoelectric patches for semi-active response control of steel special moment-resisting frames (SMRF) subjected to seismic excitations is investigated. Pairs of piezoelectric sheets bonded on the opposite faces of beams and columns are used to apply the required control couples through electric field-induced tensional or compressional strains in the piezoelectric sheets. Also, the modified Bang-Bang control algorithm as a typical control scheme is employed to determine the magnitude of the required control couples. For this purpose, Sap2000 software is utilized for modelling and time history analysis of the considered structural systems, and the MATLAB program is used to calculate the control couples. Furthermore, the open application programming interface (OAPI) codes are prepared for linking the Sap2000 and MATLAB software for online time history analysis of the structural models. The obtained results for a number of steel SMRFs with different numbers of bays and stories indicate that the application of the piezoelectric patches efficiently reduces the structural responses, including story drifts and story absolute accelerations. Also, using a design parameter, "lambda", the best placement of the piezoelectric patches for the structural models is determined, and the responses of the optimally controlled cases are compared with those for the uncontrolled ones.