Algerian dīwān (lit. 'assembly') is a healing, musico-ritual tradition that originated out of the trans-Saharan slave trade and coalesced through the segregation of these displaced sub-Saharan populations in present day Algeria who, under three centuries of Ottoman rule, were heavily influenced by the local, popular religious practices and socio-political organisation of Sufi lineages. Subsequently, dīwān gradually developed into a syncretic Afro-Maghrebi ritual practice predicated on many of the same structures of other musical traditions within popular Islam: saint veneration, trance, and musically generated ritual healing. Dīwān ritual today is considered by its practicants to belong to the family of Sufi ṭuruq, providing divine transcendence of human suffering and functioning, quite practically, as mental-emotional healthcare. What makes both of these processes possible is the ritual labouring of music. The most broadly applicable utility of music in dīwān is its ability to create community feeling or 'social warmth'-ḥāl. With dīwān music creating the critical ambience of ideal ḥāl, adepts suffering from psychological distress and/or physical pain are then triggered into varying states of trance by personal associations with musical mottoes that intensify their bodily sensoria, thus igniting a process that obliges these adepts to physically move these sensoria. By rendering private suffering public, this ability of dīwān to musically trigger and release pain means that it establishes the sufferer's place in a wider network of relations including the religious community and the supernatural world of Islam. Subsequently, social relationships are reconfigured as the community cares for the suffering of others. Being the first ethnomusicological study of dīwān, this thesis both documents and analyses musical and ritual practice while examining in detail the sensory and affective worlds of trance in dīwān to ultimately posit dīwān ritual worlds as emerging out of an affective epistemology.