---
title: "init(channel:programNumber:)"
framework: avfaudio
role: symbol
role_heading: Initializer
path: "avfaudio/avmidiprogramchangeevent/init(channel:programnumber:)"
---

# init(channel:programNumber:)

Creates a program change event with a channel and program number.

## Declaration

```swift
init(channel: UInt32, programNumber: UInt32)
```

## Parameters

- `channel`: The MIDI channel for the message, between 0 and 15.
- `programNumber`: The program number to send, between 0 and 127.

## Discussion

Discussion The instrument this chooses depends on AVMIDIControlChangeEvent.MessageType.bankSelect events sent prior to this event.
