mton
Prev | Orchestra Opcodes and Operators | Next

## mton

mton — Convert midi note number to string note name

## Description

Convert midi note number to string note name, with an accuracy of 1 cent.

## Syntax

    Snote mton kmidi

    Snote mton imidi

## Performance

kmidi / imidi -- Midi note number

Snote -- Note name

Example of note names:

    		midi    note number
    		-------------------
    		60      4C
    		60.4    4C+40
    		60.5    4C+
    		60.9    4Db-10
    		61      4C#
    		61.5    4D-

## Examples

Here is an example of the mton opcode. It uses the file mton-ntom.csd.

Example 599. Example of the ftom opcode.

    <CsoundSynthesizer>
    <CsOptions>
    --nosound
    </CsOptions>
    <CsInstruments>

    instr 1
        S4 mton ntom("7D+63")
        puts S4, 1

        S1  mton 60
        puts S1, 1

        S2 mton ftom(442)
        puts S2, 1

        S3 = mton(48.25)
        puts S3, 1

        k1 = ntom("4C")
        printk2 k1

        i2  ntom "4E"
        print i2

        S5 = mton(ntom("4G+"))
        puts S5, 1

        turnoff
    endin

    instr 2
        k1 = ntom("4Eb-31")
        printk2 k1
        i0  ntom "4C+"
        print i0
        i1 = ntom:i("4A")
        print i1
    	turnoff
    endin

    </CsInstruments>
    <CsScore>

    i 1 0 1
    i 2 0 1

    </CsScore>
    </CsoundSynthesizer>

## See Also

cpsmidinn, mtof, ftom, ntom

## Credits

By: Eduardo Moguillansky 2017

Prev | Up | Next
mtof | Home | multitap