[Csnd] transport controls with diskin2
Date | 2011-12-29 00:54 |
From | Thomas Hass |
Subject | [Csnd] transport controls with diskin2 |
Hi everyone, This is my first post to the list, but I've been loving Csound ever since Dr. B introduced it to me last year at Berklee.
I'm trying to develop some additional transport controls to work with diskin2 based off the example, SF_Play_from_HD_2.csd. The main problem that I'm encountering is that this csd keeps track of the current position in a file based off a clock. This approach doesn't account for the user changing the pitch of the file (which also alters the rate at which the file is read). So if the user presses play, raises the pitch, pauses, then resumes, the file starts at a position prior to where it should. I'm also having problems implementing a seek functionality for the same reasons. Does anyone have any examples of a file player with more transport controls?
Any help would be much appreciated. -Thomas
|
Date | 2011-12-29 09:37 |
From | Victor Lazzarini |
Subject | Re: [Csnd] transport controls with diskin2 |
Would it not be as simple as multiplying the start time by the pitch transposition and check for bounds/wraparound? On 29 Dec 2011, at 00:54, Thomas Hass wrote: Hi everyone, Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2011-12-29 14:14 |
From | Tito Latini |
Subject | Re: [Csnd] transport controls with diskin2 |
Attachments | None |
Date | 2011-12-29 21:17 |
From | Thomas Hass |
Subject | Re: [Csnd] transport controls with diskin2 |
The problem with multiplying the start time by the pitch transposition is that the user is able to change the pitch while the file is playing. So I don't think this approach will accurately track the location in the file if the user messes with the pitch during playback. I was hoping that there was another opcode related to diskin2 that returned the current read position in a file. If no such opcode exists, it would be awesome if one could be developed. Maybe the current position could be returned via one of the arguments. Thanks for the great example Tito. However, I have to keep my memory footprint pretty low in the context that I'm using Csound in and would like to avoid loading entire audio files into ftables. Thanks, Thomas
On Thu, Dec 29, 2011 at 6:14 AM, Tito Latini <tito.01beta@gmail.com> wrote: I have written a simple sound player that uses the `table3' opcode |
Date | 2011-12-29 21:32 |
From | Victor Lazzarini |
Subject | Re: [Csnd] transport controls with diskin2 |
I think you can always keep track of the pos if you scale its increment along with the changes in pitch. So when the pitch is 2, instead of incrementing by 1 control cycle (or whatever), increment it by 2 and so on. On 29 Dec 2011, at 21:17, Thomas Hass wrote: The problem with multiplying the start time by the pitch transposition is that the user is able to change the pitch while the file is playing. So I don't think this approach will accurately track the location in the file if the user messes with the pitch during playback. I was hoping that there was another opcode related to diskin2 that returned the current read position in a file. If no such opcode exists, it would be awesome if one could be developed. Maybe the current position could be returned via one of the arguments. Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2011-12-29 23:42 |
From | Iain McCurdy |
Subject | RE: [Csnd] transport controls with diskin2 |
You could use a krate phasor to mirror the time location of playback by diskin. e.g. Sfile = "Soundfile.wav" ilen filelen Sfile ;length of sound file in seconds kpos phasor gkspeed/ilen kpos = kpos * ilen ;position of playback in seconds printk 2,kptr a1,a2 diskin2 Sfile,gkspeed,0,1 Maybe this is what you are looking for... Iain Date: Thu, 29 Dec 2011 13:17:21 -0800 From: thass@berklee.edu To: csound@lists.bath.ac.uk Subject: Re: [Csnd] transport controls with diskin2 The problem with multiplying the start time by the pitch transposition is that the user is able to change the pitch while the file is playing. So I don't think this approach will accurately track the location in the file if the user messes with the pitch during playback. I was hoping that there was another opcode related to diskin2 that returned the current read position in a file. If no such opcode exists, it would be awesome if one could be developed. Maybe the current position could be returned via one of the arguments. Thanks for the great example Tito. However, I have to keep my memory footprint pretty low in the context that I'm using Csound in and would like to avoid loading entire audio files into ftables. Thanks, Thomas On Thu, Dec 29, 2011 at 6:14 AM, Tito Latini <tito.01beta@gmail.com> wrote: I have written a simple sound player that uses the `table3' opcode |
Date | 2011-12-30 02:15 |
From | Thomas Hass |
Subject | Re: [Csnd] transport controls with diskin2 |
Like Victor said, it turned out to be as simple as changing this line in instrument 10: gktimi10k = gktimi10k + 1
to: gktimi10k = gktimi10k + kpitch Thanks for the help. -Thomas On Thu, Dec 29, 2011 at 3:42 PM, Iain McCurdy <i_mccurdy@hotmail.com> wrote:
|