NyQuest Innovation Labs Q-Code User manual

Q-Code
Power-Speech Format Programmer
Version 7.0
Nov. 30, 2021
NYQUEST TECHNOLOGY CO., Ltd. reserves the right to change this document without prior notice. Information provided by NYQUEST is believed to be accurate and
reliable. However, NYQUEST makes no warranty for any errors which may appear in this document. Contact NYQUEST to obtain the latest version of device specifications
before placing your orders. No responsibility is assumed by NYQUEST for any infringement of patent or other rights of third parties which may result from its use. In addition,
NYQUEST products are not authorized for use as critical components in life support devices/systems or aviation devices/systems, where a malfunction or failure of the product
may reasonably be expected to result in significant injury to the user, without the express written approval of NYQUEST.
User Manual

Q-Code User Manual
Ver. 7.0 2021/11/30
2
Table of Content
1Introduction.......................................................................................................................... 15
1.1 Outline of the manual ............................................................................................................... 15
1.2 The Installation of Q-Code........................................................................................................ 15
2Q-Code Interface.................................................................................................................. 16
2.1 Function Menu ......................................................................................................................... 17
2.1.1 [File] Menu ....................................................................................................................................17
2.1.2 [Edit] Menu ....................................................................................................................................17
2.1.3 [Search] Menu...............................................................................................................................18
2.1.4 [Compile] Menu .............................................................................................................................18
2.1.5 [Debug] Menu................................................................................................................................19
2.1.6 [Tool] Menu....................................................................................................................................20
2.1.7 [Setting] Menu ...............................................................................................................................20
2.1.8 [Help] Menu...................................................................................................................................20
2.2 Section ..................................................................................................................................... 21
2.3 Text Edit Area ........................................................................................................................... 22
2.4 Debug Mode............................................................................................................................. 22
2.4.1 Watch Window ..............................................................................................................................22
2.4.2 Register Window ...........................................................................................................................23
2.5 Message Window..................................................................................................................... 23
2.5.1 Error List........................................................................................................................................23
2.5.2 Build Message...............................................................................................................................24
2.6 Information ............................................................................................................................... 24
2.7 Q-Code Status Bar ................................................................................................................... 24
2.7.1 Build Result and ICE Status..........................................................................................................24
2.7.2 ICE Connect Status.......................................................................................................................25
2.7.3 Row, Column, Characters .............................................................................................................25
2.7.4 Insert Mode ...................................................................................................................................25
3The Architecture of Q-Code................................................................................................ 26
3.1 Introduction of NY4 Q-Code ..................................................................................................... 27
3.2 Introduction of NY5 Q-Code ..................................................................................................... 28
3.3 Introduction of NY5+ Q-Code ................................................................................................... 29
3.4 Introduction of NY6 Q-Code ..................................................................................................... 30
3.5 Introduction of NY7 Q-Code ..................................................................................................... 31
3.6 Introduction of NY9T Q-Code ................................................................................................... 32
3.7 Introduction of NX1 OTP Q-Code ............................................................................................. 33
3.8 Introduction of NX1 EF Q-Code................................................................................................ 35

Q-Code User Manual
Ver. 7.0 2021/11/30
3
3.9 Section ..................................................................................................................................... 36
3.9.1 Option............................................................................................................................................36
3.9.2 Voice File.......................................................................................................................................64
3.9.3 Action File .....................................................................................................................................68
3.9.4 Melody Database ..........................................................................................................................69
3.9.5 Touch-Key File ..............................................................................................................................70
3.9.6 SPI Flash.......................................................................................................................................70
3.9.7Record Section..............................................................................................................................71
3.9.8 LED Sting Section .........................................................................................................................73
3.9.9 QFID Section.................................................................................................................................74
3.9.10 I/O..................................................................................................................................................78
3.9.11 Input State .....................................................................................................................................84
3.9.12 Output State ..................................................................................................................................88
3.9.13 VR .................................................................................................................................................90
3.9.14 Action Mark ...................................................................................................................................95
3.9.15 Wave Mark ....................................................................................................................................96
3.9.16 Melody Mark..................................................................................................................................97
3.9.17 Note On.........................................................................................................................................99
3.9.18 IR Receive (Infrared Receive).......................................................................................................99
3.9.19 Symbol ........................................................................................................................................100
3.9.20 Variable .......................................................................................................................................101
3.9.21 Table............................................................................................................................................101
3.9.22 ASM ............................................................................................................................................102
3.9.23 C-Code ........................................................................................................................................103
3.9.24 Macro ..........................................................................................................................................104
3.9.25 Sentence .....................................................................................................................................105
3.9.26 Subroutine...................................................................................................................................107
3.9.27 QIO Custom ................................................................................................................................107
3.9.28 Path .............................................................................................................................................110
3.9.29 Background1 ...............................................................................................................................127
3.9.30 Background2 ...............................................................................................................................127
3.9.31 Background3 ...............................................................................................................................127
4Q-Code Command ............................................................................................................. 128
4.1 Arithmetic Logic Command .................................................................................................... 128
4.1.1 Variable Operation ......................................................................................................................128
4.2 Conditional Jump Command .................................................................................................. 130
4.2.1 Comparison .................................................................................................................................131
4.2.2 Px = data?Path............................................................................................................................131
4.2.3 Px != data?Path...........................................................................................................................132
4.2.4 Px.n = 0?Path .............................................................................................................................132
4.2.5 Px.n != 0?Path ............................................................................................................................132
4.2.6 Px.n = 1?Path .............................................................................................................................132
4.2.7 Px.n != 1?Path ............................................................................................................................132
4.2.8 Px[1 X 0 X]?Path.........................................................................................................................132

Q-Code User Manual
Ver. 7.0 2021/11/30
4
4.2.9 Vol = n?Path................................................................................................................................132
4.2.10 Vol != n?Path...............................................................................................................................132
4.2.11 ChUsed(Ch)?Path.......................................................................................................................133
4.2.12 Voice(Ch)?Path ...........................................................................................................................133
4.2.13 PauseV(Ch)?Path .......................................................................................................................134
4.2.14 Melody?Path ...............................................................................................................................134
4.2.15 PauseM?Path..............................................................................................................................134
4.2.16 Delay(n)?Path .............................................................................................................................135
4.2.17 PauseD(n)?Path..........................................................................................................................135
4.2.18 Action(Ch)?Path..........................................................................................................................135
4.2.19 PauseA(Ch)?Path .......................................................................................................................135
4.2.20 PWMIO?Path ..............................................................................................................................136
4.2.21 PausePWM?Path........................................................................................................................137
4.2.22 HoldPWM(n)?Path ......................................................................................................................137
4.2.23 Pause(n)?Path ............................................................................................................................137
4.2.24 Record?Path ...............................................................................................................................137
4.2.25 KRecord?Path.............................................................................................................................138
4.2.26PlayK?Path .................................................................................................................................138
4.2.27 EraseR?Path...............................................................................................................................138
4.2.28 VR_VAD?Path.............................................................................................................................138
4.2.29 LEDStr?Path ...............................................................................................................................138
4.2.30 Calibrate?Path ............................................................................................................................139
4.2.31 CheckSum?Path .........................................................................................................................139
4.2.32 SPI_CheckSum?Path .................................................................................................................139
4.2.33 MixCtrl = data?Path ....................................................................................................................140
4.2.34 MixCtrl != data?Path ...................................................................................................................140
4.2.35 RandomL = data?Path ................................................................................................................140
4.2.36 RandomH = data?Path ...............................................................................................................140
4.2.37 RandomL != data?Path ...............................................................................................................141
4.2.38 RandomH != data?Path ..............................................................................................................141
4.2.39 Random = data?Path ..................................................................................................................141
4.2.40 Random != data?Path .................................................................................................................141
4.2.41 Switch(Ri) = [Path0, Path1, Path2,... Path15].............................................................................142
4.2.42 Switch(Px) = [Path0, Path1, Path2,… Path15] ...........................................................................142
4.2.43 Switch(RandomL) = [Path0, Path1, Path2,... Path15] ................................................................142
4.2.44 Switch(RandomH) = [Path0, Path1, Path2,… Path15] ...............................................................142
4.2.45 Switch(Xi) = [Path0, Path1, Path2,..Path255] .............................................................................143
4.2.46 Switch(Random) = [Path0, Path1, Path2,… Path255]................................................................143
4.2.47 Switch(Px[d x d x]) = [Path0, Path1, Path2,... Path15] ...............................................................143
4.3 I/O Command......................................................................................................................... 144
4.3.1 Ri = Px.........................................................................................................................................145
4.3.2 Ri = PxM......................................................................................................................................145
4.3.3 Ri.n = Px.n...................................................................................................................................145
4.3.4 PxM = data ..................................................................................................................................145
4.3.5 PxM = Ri......................................................................................................................................145

Q-Code User Manual
Ver. 7.0 2021/11/30
5
4.3.6 PxM.n = 0 ....................................................................................................................................145
4.3.7 PxM.n = 1 ....................................................................................................................................146
4.3.8 Px = data .....................................................................................................................................146
4.3.9 Px = Ri.........................................................................................................................................146
4.3.10 Px = Py........................................................................................................................................146
4.3.11 !Px ...............................................................................................................................................146
4.3.12 !Px.n ............................................................................................................................................146
4.3.13 Px.n = 0 .......................................................................................................................................146
4.3.14 Px.n = 1 .......................................................................................................................................146
4.3.15 Px.n = Ri.n...................................................................................................................................147
4.3.16 Px.n = Py.n ..................................................................................................................................147
4.3.17 Px = Py + Ri ................................................................................................................................147
4.3.18 Px = Py – Ri ................................................................................................................................147
4.3.19 Px = Py | Ri .................................................................................................................................147
4.3.20 Px = Py ^ Ri.................................................................................................................................147
4.3.21 Px = Py & Ri ................................................................................................................................147
4.3.22 Ri = Px + Rj .................................................................................................................................147
4.3.23 Ri = Px – Rj .................................................................................................................................148
4.3.24 Ri = Px | Rj ..................................................................................................................................148
4.3.25 Ri = Px ^ Rj .................................................................................................................................148
4.3.26 Ri = Px & Rj.................................................................................................................................148
4.3.27 Px = Py + data.............................................................................................................................148
4.3.28 Px = Py – data.............................................................................................................................148
4.3.29 Px = Py | data..............................................................................................................................148
4.3.30 Px = Py ^ data .............................................................................................................................148
4.3.31 Px = Py & data ............................................................................................................................149
4.3.32 Ri = Px + data .............................................................................................................................149
4.3.33 Ri = Px – data..............................................................................................................................149
4.3.34 Ri = Px | data...............................................................................................................................149
4.3.35 Ri = Px ^ data..............................................................................................................................149
4.3.36 Ri = Px & data .............................................................................................................................149
4.3.37 Px = [1 X 0 FD An Q ]..................................................................................................................149
4.3.38 [Px.n …] = [1 0 X Q] ....................................................................................................................150
4.3.39 Px.n = 1KHz(time) .......................................................................................................................150
4.3.40 XiL = Px.......................................................................................................................................151
4.3.41 XiH = Px ......................................................................................................................................151
4.3.42 XiL.n = Px.n.................................................................................................................................151
4.3.43 XiH.n = Px.n ................................................................................................................................151
4.3.44 Xi.n = Px.n...................................................................................................................................151
4.3.45 Xi = [Px, Py].................................................................................................................................151
4.3.46 Px = XiL.......................................................................................................................................151
4.3.47 Px = XiH ......................................................................................................................................151
4.3.48 Px.n = XiL.n.................................................................................................................................152
4.3.49 Px.n = XiH.n ................................................................................................................................152
4.3.50 Px.n = Xi.n...................................................................................................................................152

Q-Code User Manual
Ver. 7.0 2021/11/30
6
4.3.51 [Px, Py] = Xi.................................................................................................................................152
4.4 Path Command ...................................................................................................................... 152
4.4.1 ASM ............................................................................................................................................152
4.4.2 C-Code........................................................................................................................................153
4.4.3 BG(BG1, BG2, BG3) ...................................................................................................................154
4.4.4 Break ...........................................................................................................................................154
4.4.5 StopFG ........................................................................................................................................155
4.4.6 StopBG ........................................................................................................................................155
4.4.7 StopBG1......................................................................................................................................155
4.4.8 StopBG2......................................................................................................................................156
4.4.9 StopBG3......................................................................................................................................156
4.4.10 Subroutine...................................................................................................................................156
4.4.11 Label(Pathname).........................................................................................................................157
4.4.12 Macro ..........................................................................................................................................157
4.4.13 1ms_RET ....................................................................................................................................157
4.4.14 4ms_RET ....................................................................................................................................158
4.5 Voice Command..................................................................................................................... 158
4.5.1 PlayV / PlayVS(Ch, Parameter1 {++} , Parameter2) ..................................................................158
4.5.2 WaitVN(Ch) .................................................................................................................................162
4.5.3 PauseV(Ch).................................................................................................................................162
4.5.4 ResumeV(Ch) .............................................................................................................................163
4.5.5 StopV(Ch)....................................................................................................................................164
4.5.6 FreqCH = nK ...............................................................................................................................164
4.5.7 V_Chx_Vol = n / V_Chx_Vol = Xi................................................................................................164
4.5.8 Xi = V_Chx_Vol ...........................................................................................................................165
4.5.9 SBC_Loop_On ............................................................................................................................165
4.5.10 SBC_Loop_Off ............................................................................................................................165
4.5.11 ADPCM_Loop_On ......................................................................................................................166
4.5.12 ADPCM_Loop_Off ......................................................................................................................166
4.6 Record Command .................................................................................................................. 166
4.6.1 Record / RecordS........................................................................................................................166
4.6.2 WaitRN ........................................................................................................................................167
4.6.3 StopR ..........................................................................................................................................167
4.6.4 EraseR / EraseRS.......................................................................................................................167
4.6.5 WaitEN ........................................................................................................................................168
4.7 Sentence Command............................................................................................................... 168
4.7.1 PlayS(Parameter)........................................................................................................................168
4.7.2 WaitSN(n)....................................................................................................................................169
4.7.3 PauseS(n) ...................................................................................................................................169
4.7.4 ResumeS(n) ................................................................................................................................170
4.7.5 StopS(n) ......................................................................................................................................170
4.8 SPI Play Command................................................................................................................ 171
4.8.1 SPIPlay / SPIPlayS .....................................................................................................................171

Q-Code User Manual
Ver. 7.0 2021/11/30
7
4.8.2 SPIWaitN(Ch)..............................................................................................................................173
4.8.3 SPIStop(Ch) ................................................................................................................................173
4.8.4 SPIPause(Ch) .............................................................................................................................173
4.8.5 SPIResume(Ch) ..........................................................................................................................173
4.8.6 SPIVol = n /SPIVol = Ri...............................................................................................................173
4.8.7 Ri = SPIVol ..................................................................................................................................174
4.8.8 SPIGetIndex................................................................................................................................174
4.9 SPI Flash Command .............................................................................................................. 174
4.9.1 SPI_CS_On(SpiGroup)...............................................................................................................175
4.9.2 SPI_CS_Off(SpiGroup) ...............................................................................................................175
4.9.3 SPI_TX(Data, SPIGroup) ............................................................................................................176
4.9.4 SPI_RX(Result, SPIGroup).........................................................................................................176
4.9.5 SPI_WREN .................................................................................................................................177
4.9.6 SPI_WRDIS ................................................................................................................................177
4.9.7 SPI_RDID(Result, SPIGroup) .....................................................................................................178
4.9.8 SPI_CE .......................................................................................................................................178
4.9.9 SPI_SE(Addr, Count, SPIGroup) ................................................................................................179
4.9.10 SPI_BE(Addr, Count, SPIGroup) ................................................................................................180
4.9.11 SPI_DP(SPIGroup) .....................................................................................................................181
4.9.12 SPI_RDP(Result, SPIGroup) ......................................................................................................181
4.9.13 SPI_WRSR(Data, SPIGroup) .....................................................................................................182
4.9.14 SPI_RDSR(Result, SPIGroup)....................................................................................................182
4.9.15 SPI_WRD(Addr, Data, SPIGroup) ..............................................................................................183
4.9.16 SPI_RDD(Addr, Result, SPIGroup).............................................................................................184
4.9.17 SPI_GetAddr(Index, Result, SPIGroup)......................................................................................184
4.10 Comparator Command........................................................................................................... 185
4.10.1 CMP_ON / CMP_ON(Source) ....................................................................................................185
4.10.2 CMP_OFF ...................................................................................................................................186
4.10.3 CMP_Read(Rj:Ri) / CMP_Read(Xi) ............................................................................................186
4.10.4 CMP_CNT_ON (Count) ..............................................................................................................186
4.10.5 CMP_CNT_OFF..........................................................................................................................187
4.11 Counter Command................................................................................................................. 187
4.11.1 TMR_ON .....................................................................................................................................187
4.11.2 TMR_OFF ...................................................................................................................................187
4.11.3 TMR_Read(Rj:Ri) / TMR_Read(Xi) ............................................................................................188
4.12 MIDI Command ...................................................................................................................... 188
4.12.1 PlayM / PlayMS(Parameter {++} )...............................................................................................188
4.12.2 WaitMN........................................................................................................................................191
4.12.3 PauseM .......................................................................................................................................191
4.12.4 ResumeM....................................................................................................................................192
4.12.5 StopM..........................................................................................................................................192
4.12.6 Instrument(Ch, i) .........................................................................................................................192
4.12.7 M_Chx_Vol = n / M_Chx_Vol = Ri ..............................................................................................193
4.12.8 Ri = M_Chx_Vol ..........................................................................................................................193

Q-Code User Manual
Ver. 7.0 2021/11/30
8
4.12.9 Tempo + n ...................................................................................................................................193
4.12.10 Tempo - n ....................................................................................................................................194
4.12.11 Tempo++ .....................................................................................................................................194
4.12.12 Tempo-- .......................................................................................................................................194
4.12.13 TempoRst ....................................................................................................................................195
4.12.14 Tempo = n ...................................................................................................................................195
4.12.15 Tempo(Ri:Rj) / Tempo(Xi)............................................................................................................196
4.12.16 ReadTempo(Ri:Rj) / ReadTempo(Xi) ..........................................................................................196
4.12.17 Mute_On(Ch) ..............................................................................................................................196
4.12.18 Mute_Off(Ch) ..............................................................................................................................197
4.12.19 OKON_On / SingleNote_On .......................................................................................................197
4.12.20 OKON_Off / SingleNote_Off .......................................................................................................198
4.12.21 OKON_Play / SinglePlay ............................................................................................................198
4.12.22 DynamicOn .................................................................................................................................198
4.12.23 DynamicOff .................................................................................................................................199
4.12.24 StopMNote ..................................................................................................................................199
4.12.25 MIDI_Pitch(Semitone) .................................................................................................................199
4.12.26 Mask_On(Ch)..............................................................................................................................200
4.12.27 Mask_Off(Ch)..............................................................................................................................200
4.13 Keyboard Command .............................................................................................................. 201
4.13.1 InstNoteOn(Index, Note, Vol) & InstNoteOff(Note) .....................................................................201
4.13.2 InstNoteAllOff ..............................................................................................................................201
4.13.3 DrumNoteOn(Index, Vol) & DrumNoteOff(Index)........................................................................202
4.13.4 NoteVibrato = n / NoteVibrato = Ri..............................................................................................202
4.13.5 Gliss(Note, Semitone, Time).......................................................................................................203
4.13.6 MaxSingleNote = n / MaxSingleNote = Ri...................................................................................203
4.13.7 LongInst_HoleTime .....................................................................................................................204
4.13.8 ShortInst_HoldTime ....................................................................................................................204
4.13.9 KRecord / KRecordS...................................................................................................................204
4.13.10 WaitKRN......................................................................................................................................205
4.13.11 StopKR ........................................................................................................................................206
4.13.12 PlayK / PlayKS ............................................................................................................................206
4.13.13 WaitKN ........................................................................................................................................206
4.13.14 StopK...........................................................................................................................................207
4.14 Volume Command.................................................................................................................. 207
4.14.1 Vol_Max ......................................................................................................................................207
4.14.2 Vol_Min .......................................................................................................................................207
4.14.3 Vol = n .........................................................................................................................................207
4.14.4 Vol = Ri........................................................................................................................................208
4.14.5 Vol++ ...........................................................................................................................................208
4.14.6 Vol--.............................................................................................................................................208
4.14.7 Ri = Vol........................................................................................................................................208
4.14.8 Px = Vol .......................................................................................................................................208
4.14.9 Vol += n .......................................................................................................................................208

Q-Code User Manual
Ver. 7.0 2021/11/30
9
4.14.10 Vol -= n ........................................................................................................................................209
4.14.11 VolX1 ...........................................................................................................................................209
4.14.12 VolX2 ...........................................................................................................................................209
4.14.13 CHx_VOL = n ..............................................................................................................................209
4.14.14 PP_Gain = n................................................................................................................................209
4.14.15 PP_Gain = Ri ..............................................................................................................................210
4.14.16 PP_Gain++..................................................................................................................................210
4.14.17 PP_Gain-- ...................................................................................................................................211
4.14.18 Ri = PP_Gain ..............................................................................................................................211
4.14.19 PGA_Gain = n .............................................................................................................................211
4.14.20 PGA_Gain = Ri ...........................................................................................................................212
4.14.21 Ri = PGA_Gain ...........................................................................................................................212
4.14.22 Ri = MixCtrl..................................................................................................................................212
4.14.23 Px = MixCtrl.................................................................................................................................212
4.14.24 MixCtrl .........................................................................................................................................213
4.15 TouchKey Command .............................................................................................................. 213
4.15.1 TouchKey_ON .............................................................................................................................214
4.15.2 TouchKey_OFF ...........................................................................................................................214
4.15.3 TouchKey_CLR ...........................................................................................................................214
4.15.4 TouchKey_Scan_Slow ................................................................................................................215
4.15.5 TouchKey_Scan_Normal ............................................................................................................215
4.15.6 TouchKey_Sensitivity (Level) ......................................................................................................215
4.15.7 Calibrate_ON ..............................................................................................................................216
4.15.8 Calibrate_OFF.............................................................................................................................216
4.15.9 AutoJudge_Calibrate...................................................................................................................216
4.15.10 Enforce_Calibrate_Normal..........................................................................................................217
4.15.11 Enforce_Calibrate_Sleep ............................................................................................................217
4.15.12 Ri = TouchKey(Px) ......................................................................................................................218
4.15.13 Var = Touchkey_Count(TouchKey) .............................................................................................218
4.15.14 Var = Touchkey_BGCount(TouchKey) ........................................................................................218
4.16 Table Command ..................................................................................................................... 219
4.16.1 TableL(TableName, Rx/Xx, Ry/Xy, Ri) ........................................................................................219
4.16.2 TableM(TableName, Rx/Xx, Ry/Xy, Ri) .......................................................................................219
4.16.3 TableH(TableName, Rx/Xx, Ry/Xy, Ri)........................................................................................219
4.16.4 Table(TableName, Rx/Xx, Ry/Xy, Rh, Rm, Rl) / Table(TableName, Rx/Xx, Ry/Xy, Ri) ...............220
4.16.5 TableL(TableName, X, Y, Ri) .......................................................................................................221
4.16.6 TableM(TableName, X, Y, Ri) ......................................................................................................221
4.16.7 TableH(TableName, X, Y, Ri) ......................................................................................................221
4.16.8 Table(TableName, X, Y, Rh, Rm, Rl) / Table(TableName, X, Y, Ri) ............................................221
4.16.9 TableL(TableName, Rx/Xx, Ry/Xy, Xi) ........................................................................................222
4.16.10 TableH(TableName, Rx/Xx, Ry/Xy, Xi)........................................................................................222
4.16.11 Table(TableName, Rx/Xx, Ry/Xy, Xh, Xl) ....................................................................................223
4.16.12 TableL(TableName, X, Y, Xi) .......................................................................................................223
4.16.13 TableH(TableName, X, Y, Xi).......................................................................................................223

Q-Code User Manual
Ver. 7.0 2021/11/30
10
4.16.14 Table(TableName, X, Y, Xh, Xl)...................................................................................................224
4.16.15 Ret = TableName[X][Y] ...............................................................................................................224
4.17 IR Command.......................................................................................................................... 225
4.17.1 IR_TX=data .................................................................................................................................225
4.17.2 IR_TX(Rl:Rk:Rj:Ri) ......................................................................................................................225
4.17.3 IR_TX(Xj:Xi) ................................................................................................................................225
4.17.4 IR_RX_ON ..................................................................................................................................226
4.17.5 IR_RX_OFF ................................................................................................................................226
4.17.6 IR_RX = data?Path .....................................................................................................................226
4.17.7 IR_RX != data?Path ....................................................................................................................226
4.17.8 [Rl, Rk, Rj, Ri] = IR_RX...............................................................................................................226
4.17.9 [Xj, Xi] = IR_RX ...........................................................................................................................227
4.18 Serial Control TX Command................................................................................................... 227
4.18.1 SC_TX(Mode, Parameter) ..........................................................................................................227
4.18.2 SC_TX(Mode, Ri:Rj:Rl:Rk) .........................................................................................................228
4.18.3 SC_TX(Mode, Xi:Xj)....................................................................................................................228
4.19 Serial Control Command ........................................................................................................ 229
4.19.1 SC_RX_ON.................................................................................................................................229
4.19.2 SC_RX_OFF ...............................................................................................................................229
4.19.3 SC_RX = data?Path....................................................................................................................229
4.19.4 SC_RX != data?Path...................................................................................................................229
4.19.5 [Rl, Rk, Rj, Ri] = SC_RX .............................................................................................................230
4.19.6 [Xj, Xi] = SC_RX..........................................................................................................................230
4.20 PWMIO Command ................................................................................................................. 230
4.20.1 PWMOut / PWMOutS..................................................................................................................230
4.20.2 PlayPWM / PlayPWMS(PWMEn, $VIOLabel, Extension) ..........................................................232
4.20.3 WaitPN ........................................................................................................................................234
4.20.4 StopPWM ....................................................................................................................................234
4.20.5 PausePWM .................................................................................................................................234
4.20.6 ResumePWM ..............................................................................................................................234
4.20.7 HoldPWM ....................................................................................................................................235
4.20.8 PWMCtrl(@PWMEn, Extension).................................................................................................235
4.20.9 PWMDuty ....................................................................................................................................235
4.21 Interrupt Command ................................................................................................................ 236
4.21.1 INT_ON .......................................................................................................................................236
4.21.2 INT_OFF .....................................................................................................................................236
4.21.3 INT_RET .....................................................................................................................................236
4.21.4 INT = n ........................................................................................................................................237
4.22 Delay Command .................................................................................................................... 237
4.22.1 Delay(Time).................................................................................................................................237
4.22.2 Delay(Ri:Rj:Rk) ...........................................................................................................................237
4.22.3 WaitDN(n)....................................................................................................................................238
4.22.4 StopD(n) ......................................................................................................................................238

Q-Code User Manual
Ver. 7.0 2021/11/30
11
4.22.5 PauseD(n) ...................................................................................................................................238
4.22.6 ResumeD(n)................................................................................................................................239
4.22.7 SDelay(time) ...............................................................................................................................239
4.23 Action Command.................................................................................................................... 239
4.23.1 PlayA / PlayAS ............................................................................................................................240
4.23.2 WaitAN(Ch) .................................................................................................................................241
4.23.3 PauseA(Ch).................................................................................................................................241
4.23.4 ResumeA(Ch) .............................................................................................................................241
4.23.5 HoldA(Ch) ...................................................................................................................................241
4.23.6 StopA(Ch)....................................................................................................................................241
4.24 LED String Commmand.......................................................................................................... 242
4.24.1 LEDStr_Play / LEDStr_PlayS......................................................................................................242
4.24.2 LEDStr_Stop ...............................................................................................................................242
4.24.3 LEDStr_Clear ..............................................................................................................................242
4.24.4 LEDStr_Brightness......................................................................................................................243
4.25 QFID Command ..................................................................................................................... 243
4.25.1 QFID_GroupID(Ri) ......................................................................................................................243
4.25.2 QFID_TagId (GroupID, Rl:Rk:Rj:Ri)............................................................................................243
4.25.3 QFID_TagInput (ID, Ri) ...............................................................................................................243
4.25.4 QFID_On.....................................................................................................................................244
4.25.5 QFID_Off.....................................................................................................................................244
4.25.6 QFID_SlowOn .............................................................................................................................244
4.25.7 QFID_SlowOff .............................................................................................................................244
4.26 WaveID Command ................................................................................................................. 245
4.26.1 WaveID_RX_ON .........................................................................................................................245
4.26.2 WaveID_RX_OFF .......................................................................................................................245
4.26.3 WaveID_RX ................................................................................................................................245
4.26.4 WaveID_TX(Ri) ...........................................................................................................................245
4.27 RFC Command ...................................................................................................................... 246
4.27.1 RFC_On ......................................................................................................................................246
4.27.2 RFC_Off ......................................................................................................................................246
4.27.3 RFC_Level(Ri) ............................................................................................................................246
4.28 VR Command......................................................................................................................... 246
4.28.1 VR State ......................................................................................................................................246
4.28.2 VR_ON........................................................................................................................................247
4.28.3 VR_OFF ......................................................................................................................................247
4.28.4 VR_VAD=n..................................................................................................................................247
4.28.5 VR_VAD_On ...............................................................................................................................249
4.28.6 VR_VAD_Off ...............................................................................................................................249
4.28.7 VRGC_Timeout_CLR..................................................................................................................249
4.28.8 Ri = VR_HitScore........................................................................................................................249
4.28.9 Ri = VR_HitID..............................................................................................................................249
4.28.10 VR_Loading ................................................................................................................................250

Q-Code User Manual
Ver. 7.0 2021/11/30
12
4.28.11 VT_Training.................................................................................................................................250
4.28.12 VT_Delete ...................................................................................................................................250
4.28.13 VT_DeleteAll ...............................................................................................................................250
4.28.14 VT_TrainingNum .........................................................................................................................250
4.29 Sound Effect Command ......................................................................................................... 251
4.29.1 PitchChange................................................................................................................................251
4.29.2 PitchChange_Off.........................................................................................................................252
4.29.3 SpeedChange .............................................................................................................................252
4.29.4 SpeedChange_Off ......................................................................................................................253
4.29.5 Robot1.........................................................................................................................................254
4.29.6 Robot1_Off..................................................................................................................................254
4.29.7 Robot2.........................................................................................................................................254
4.29.8 Robot2_Off..................................................................................................................................254
4.29.9 Robot3.........................................................................................................................................255
4.29.10 Robot3_Off..................................................................................................................................255
4.29.11 Robot4.........................................................................................................................................255
4.29.12 Robot4_Off..................................................................................................................................255
4.29.13 Echo ............................................................................................................................................256
4.29.14 Echo_Off .....................................................................................................................................256
4.29.15 Reverb.........................................................................................................................................256
4.29.16 Reverb_Off..................................................................................................................................257
4.30 Real Time Play Command...................................................................................................... 257
4.30.1 RT_Play.......................................................................................................................................257
4.30.2 RT_Play_Off................................................................................................................................257
4.30.3 RT_PitchChange.........................................................................................................................258
4.30.4 RT_PitchChange_Off ..................................................................................................................259
4.30.5 RT_Robot1..................................................................................................................................259
4.30.6 RT_Robot1_Off ...........................................................................................................................259
4.30.7 RT_Robot2..................................................................................................................................259
4.30.8 RT_Robot2_Off ...........................................................................................................................259
4.30.9 RT_Robot3..................................................................................................................................260
4.30.10 RT_Robot3_Off ...........................................................................................................................260
4.30.11 RT_Robot4..................................................................................................................................260
4.30.12 RT_Robot4_Off ...........................................................................................................................260
4.30.13 RT_Echo .....................................................................................................................................260
4.30.14 RT_Echo_Off...............................................................................................................................261
4.30.15 RT_Reverb..................................................................................................................................261
4.30.16 RT_Reverb_Off ...........................................................................................................................261
4.30.17 RT_Ghost ....................................................................................................................................261
4.30.18 RT_Ghost_Off .............................................................................................................................261
4.31 MISC Command..................................................................................................................... 261
4.31.1 Input State ...................................................................................................................................262
4.31.2 Action Mark State........................................................................................................................262
4.31.3 Wave Mark State.........................................................................................................................263

Q-Code User Manual
Ver. 7.0 2021/11/30
13
4.31.4 Melody Mark State ......................................................................................................................263
4.31.5 NoteOn State...............................................................................................................................264
4.31.6 QFID State ..................................................................................................................................264
4.31.7 Key_CLR.....................................................................................................................................265
4.31.8 Key_ON.......................................................................................................................................265
4.31.9 Key_OFF.....................................................................................................................................265
4.31.10 Stop .............................................................................................................................................266
4.31.11 Pause(n)......................................................................................................................................266
4.31.12 Resume(n) ..................................................................................................................................266
4.31.13 ReadChannel(Ri:Rj) / ReadChannel(Xi) .....................................................................................267
4.31.14 PauseDown.................................................................................................................................267
4.31.15 ResumeUp ..................................................................................................................................267
4.31.16 Audio_ON....................................................................................................................................268
4.31.17 Audio_OFF..................................................................................................................................268
4.31.18 AudioMode=n ..............................................................................................................................268
4.31.19 NoiseFilter_ON(Ch).....................................................................................................................269
4.31.20 NoiseFilter_OFF..........................................................................................................................269
4.31.21 AGC_On......................................................................................................................................270
4.31.22 AGC_Off......................................................................................................................................270
4.31.23 RampUp ......................................................................................................................................270
4.31.24 RampDown .................................................................................................................................271
4.31.25 AutoSleep_On.............................................................................................................................271
4.31.26 AutoSleep_Off.............................................................................................................................271
4.31.27 WDT_CLR...................................................................................................................................272
4.31.28 Repeat.........................................................................................................................................272
4.31.29 Slow ............................................................................................................................................272
4.31.30 SlowOff........................................................................................................................................272
4.31.31 END.............................................................................................................................................273
4.31.32 ReadRollingCode(Ri:Rj:Rk:Rl:Rm) .............................................................................................273
4.31.33 ChMode(n) ..................................................................................................................................273
4.31.34 ReadRadj(Ri) ..............................................................................................................................274
4.31.35 SW_Reset ...................................................................................................................................274
4.31.36 Debounce(Time) .........................................................................................................................275
4.31.37 Direct_Debounce(Time) ..............................................................................................................275
4.31.38 Matrix_Debounce(Time)..............................................................................................................276
4.31.39 Ri = LVD ......................................................................................................................................276
5Appendix ............................................................................................................................ 277
5.1 Related Tools ......................................................................................................................... 277
5.1.1 Related Software Tools ...............................................................................................................277
5.1.2 Related Hardware Tools..............................................................................................................277
5.2 Insert Control Code to WAV File by Using Quick-IO ............................................................... 279
5.3 Using Q-Sound Functions in Q-Code ..................................................................................... 280
5.4 Command Table of Q-Code.................................................................................................... 284

Q-Code User Manual
Ver. 7.0 2021/11/30
14
5.4.1 Command Table of NY4..............................................................................................................284
5.4.2 Command Table of NY5..............................................................................................................286
5.4.3 Command Table of NY5+............................................................................................................290
5.4.4 Command Table of NY6..............................................................................................................293
5.4.5 Command Table of NY7..............................................................................................................298
5.4.6 Command Table of NY9T............................................................................................................302
5.4.7 Command Table of NX1 OTP .....................................................................................................305
5.4.8 Command Table of NX1 EF ........................................................................................................309
5.5 NX1 Audio Channel ................................................................................................................ 313
5.6 RAM Resources ..................................................................................................................... 315
5.6.1 Command for NY4 RAM Resources ...........................................................................................315
5.6.2 Command for NY5 RAM Resources ...........................................................................................316
5.6.3 NY5+Memory Allocation..............................................................................................................318
5.6.4 NY6 Memory Allocation...............................................................................................................319
5.6.5 NY7 Memory Allocation...............................................................................................................319
5.6.6 NY9T Memory Allocation ............................................................................................................319
5.7 Corresponding Table of Ri and Xi ........................................................................................... 323
5.8 Sample Rate Table................................................................................................................. 324
5.8.1 NY4 / NY5 Sample Rate Table....................................................................................................324
5.9 Unusable Commands for Special Path ................................................................................... 326
5.10 Serial Control Protocol ........................................................................................................... 327
5.11 Development Flowchart of Q-Code ........................................................................................ 329
5.11.1 NY4 Flowchart.............................................................................................................................329
5.11.2 NY5 Flowchart.............................................................................................................................329
5.11.3 NY5+ Flowchart ..........................................................................................................................330
5.11.4 NY6 Flowchart.............................................................................................................................330
5.11.5 NY7 Flowchart.............................................................................................................................331
5.11.6 NY9T Flowchart ..........................................................................................................................331
5.11.7 NX1 Flowchart.............................................................................................................................332
5.12 Convert To NY5+.................................................................................................................... 333
6Revision History ................................................................................................................ 334

Q-Code User Manual
Ver. 7.0 2021/11/30
15
1 Introduction
Q-Code is an application development tool for NY4 / NY5 / NY5+ / NY6 / NY7 / NY9T / NX1 series IC of
Nyquest Technology Co., Ltd. It provides a simple graphical user interface to complete the development of
application program. Engineers will be able to utilize the powerful features to complete the development of
application program even without the understanding of hardware structure and assembly language. This way
the product development process is simplified and the product development efficiency is enhanced.
1.1 Outline of the manual
1 Introduction
This chapter is for explaining the need for Q-Code and the basic requirements for the installation of
Q-Code.
2 Q-Code Interface
This chapter is for introducing the function and basic operation of Q-Code interface to gain preliminary
knowledge of Q-Code interface.
3 Q-Code Architecture
User will understand the basic steps of development by using Q-Code in this chapter.
4 Q-Code Command
User will understand how to use Q-Code commands in this chapter.
5 Appendix
This chapter is for introducing some associated contents of Q-Code which can be helpful for Q-Code
user.
1.2 The Installation of Q-Code
Please contact Nyquest Technology to obtain the latest installation program. Double click on the
installation program to activate installation wizard, and follow the instructions to complete the installation
process.
System requirements:
A PC compiled with Pentium 1.3GHz or higher CPU, Windows XP / Win7 / Win8 / Win10.
At least 1G of RAM.
At least 2G free space on the hard disk.
A display card and monitor that support 1024x768 or higher resolution.
Microsoft .Net Framework 4.0 installed.

Q-Code User Manual
Ver. 7.0 2021/11/30
16
2 Q-Code Interface
Text Edit Area
Message Window
Function Menu
Shortcut
Sections
Status Bar
Section Indicator

Q-Code User Manual
Ver. 7.0 2021/11/30
17
2.1 Function Menu
The function menu contains: File, Edit, Search, Compile, Tool, and Help.
2.1.1 [File] Menu
The following menu will appear by clicking [File].
New:Create a new .qc file.
Open:Open a .qc file.
Save:Save .qc file.
Save As:Save .qc file as another name or to another path.
Export Project: Export .qc file and the used files to another
directory.
Convert To NY5+: Convert .qc file to NY5+ project. The detail
in 5.12.
Note: Only NY5 supports.
Recent Files:Open a recently accessed .qc file. When a file is
closed, it will automatically be added to the
“Recent Files” list.
Exit:Exit Q-Code.
2.1.2 [Edit] Menu
The following menu will appear by clicking [Edit].
Undo:Recover the previous step during editing.
Redo:Cancel the previous Undo action during editing.
Cut:Cut out a certain text block during editing.
Copy:Copy out text in a certain block during editing.
Paste:This feature is for pasting cut or copied block.
Select All:This feature is for selecting all contents.
Delete:Delet text currently selected by the cursor.
Comment Selection:For making comments on cursor location
or selected multiple lines.
Uncomment Selection:For canceling comments on cursor
location or selected multiple lines.

Q-Code User Manual
Ver. 7.0 2021/11/30
18
2.1.3 [Search] Menu
The following menu will appear by clicking [Search].
Find:This text area is for typing in string or number to be found in program.
Replace:This text area is for replacing current matching string.
Match Case:This feature is for case-sensitive searching.
Match Whole Word:When this function is selected, it will seek words that match to the input text.
(Partially matched words will not be sought).
Forward:This feature is for finding the forward matching string.
Backward:This feature is for finding the backward matching string.
Find Next:This feature is for finding the next string.
Replace:This button is for replacing current matching string.
Replace All:This button is for replacing all matching strings.
2.1.4 [Compile] Menu
The following menu will appear by clicking [Compile].
Build:For compiling current .qc file into .bin file to be downloaded to ICE or Flash Demo Board for
verification. In order to speed up compiling time, if the resource file has been built and remains
unchanged, it won’t be built again. After the completion of compilation, the result will be shown
in Build Message window and the ROM usage will be shown in “Information”.
Rebuild: No matter the resource files are built or not, the data will be clear and rebuild to the new .bin

Q-Code User Manual
Ver. 7.0 2021/11/30
19
file.
2.1.5 [Debug] Menu
The following menu will appear by clicking [Debug].
This feature is for the need of using ICE to debug while users are using Q-Code. For using this feature,
ICE or NX_Programmer must be connected to the USB port of the computer first
Download To SPI Flash: Download data to SPI Flash. (Only NY6 series supports this function.)
Full Download: Download the full program and data to ICE and SPI Flash. It needs computer to
connect the NX_Programmer.User can choose download to ROM, SPI Flash or both.
(This function only supports NX1 series)
Free Run: Execute ICE, and the process cannot be interrupted.
Run: Execute ICE, and the process can be interrupted for debugging. (This function only supports
NX1 series)
Stop: Stop ICE.
Reset: Reset without power-off.
Pause: Pause ICE.
Step: Execute ICE step by step.
Toggle Breakpoint: Add or delete the breakpoint.
NY4 / NY5 / NY5+
/ NY7 / NY9T
NY6
NX1
Configure
Download

Q-Code User Manual
Ver. 7.0 2021/11/30
20
Clear Breakpoint: Remove all breakpoints.
Configure Download: User could download built program to different kinds of demo kits by this setting.
This function is supported by Emulator Ver.A, Emulator Ver.B, and
NX_Programmer.After setting, files will be downloaded in accordance with
settings when Download executed.
2.1.6 [Tool] Menu
The following menu will appear by clicking [Tool].
Q-MIDI:This software is used to edit MIDI and timbre. Generated file’s
extension is .qmd, which can be used in NY5 / NY5+ / NY6 /
NY7 / NX1.
Quick-IO:This software is for drawing the signals of output pin. It must
be used together with WAV file and the extension name of
the generated file is .nyq.
Q-Visio:This software is for drawing the signals of output pin and the extension name of the
generated file is .vio.
Q-Touch: This software is for Touch-Key calibration, and the extension of generated file is .t9x.
Q-Writer:This software is for programming the BIN file into Flash Demo Board, Romter or OTP for
verification.
QFID Tag Generator: This option is for generating the .bin file of the QFID application which is used
by Tag. Tag Generator is for NY7 / NX1 series only.
2.1.7 [Setting] Menu
The following menu will appear by clicking [Setting].
Auto Complete: Tick to enable the auto complete function.
2.1.8 [Help] Menu
The following menu will appear by clicking [Help].
Table of contents
Other NyQuest Innovation Labs Synthesizer manuals