nrpn
Prev | Orchestra Opcodes and Operators | Next

## nrpn

nrpn — Sends a Non-Registered Parameter Number to the MIDI OUT port.

## Description

Sends a NPRN (Non-Registered Parameter Number) message to the MIDI OUT port each time one of the input arguments changes.

## Syntax

    nrpn kchan, kparmnum, kparmvalue

## Performance

kchan -- MIDI channel (1-16)

kparmnum -- number of NRPN parameter

kparmvalue -- value of NRPN parameter

This opcode sends new message when the MIDI translated value of one of the input arguments changes. It operates at k-rate. Useful with the MIDI instruments that recognize NRPNs (for example with the newest sound-cards with internal MIDI synthesizer such as SB AWE32, AWE64, GUS etc. in which each patch parameter can be changed during the performance via NRPN)

## Examples

Here is an example of the nrpn opcode. It uses the file nrpn.csd.

Example 620. Example of the nrpn opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

This example generates notes for every note received on the MIDI input. It generates MIDI notes on csound's MIDI output, so be sure to connect something.

    <CsoundSynthesizer>
    <CsOptions>
    ; Select audio/midi flags here according to platform
    -odac  -Q1   ;;;realtime audio out with MIDI out
    ;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
    </CsOptions>
    <CsInstruments>

    sr = 44100
    ksmps = 32
    nchnls = 2
    0dbfs  = 1

    instr 1	; change attack time of external synth

    initc7 1, 6, 0		; set controller 6 to 0
    nrpn 1, 99, 1		; set MSB
    nrpn 1, 98, 99		; set LSB
    katt ctrl7 1, 6, 1, 127	; DataEntMSB
    idur = 2
    noteondur2 1, 60, 100, idur ; play note on synth

    endin
    </CsInstruments>
    <CsScore>

    i 1 0 3
    e
    </CsScore>
    </CsoundSynthesizer>

## Credits

Author: Gabriel Maldonado
Italy
1998

New in Csound version 3.492

Thanks goes to Rasmus Ekman for pointing out the correct MIDI channel and controller number ranges.

Prev | Up | Next
nreverb | Home | nsamp