Csound Csound-dev Csound-tekno Search About

[Csnd-dev] default types in contextes

Date2025-07-27 11:03
Fromjoachim heintz
Subject[Csnd-dev] default types in contextes
hi all -

i am doing my first extended csound program (a generative sound 
installation) with the amazing new features of current CS7.  it is such 
a pleasure to work this way, and it is also so interesting to see how 
big the impact of such a small change is that we can name variables now 
without the leading i/k/a etc.

one desire arose while working this way:
would it be possible to assign the type of a variable automatically if 
the context is unambiguous?  for instance:

	my_number = random:k(1,2)

here the variable my_number is obviously of type k.

or for p-field i would suggest to set i as default type, like

	freq = p4

in case there is another type, we can still write

	filename:S = p4

i have no idea whether this is possible and others agree, and if so, how 
complicated it might be.  certainly nothing urgent.

	joachim

Date2025-07-27 14:43
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] default types in contextes
There is a longstanding enhancement issue on this


Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2025, at 07:04, joachim heintz <jh@joachimheintz.de> wrote:

*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

hi all -

i am doing my first extended csound program (a generative sound
installation) with the amazing new features of current CS7.  it is such
a pleasure to work this way, and it is also so interesting to see how
big the impact of such a small change is that we can name variables now
without the leading i/k/a etc.

one desire arose while working this way:
would it be possible to assign the type of a variable automatically if
the context is unambiguous?  for instance:

      my_number = random:k(1,2)

here the variable my_number is obviously of type k.

or for p-field i would suggest to set i as default type, like

      freq = p4

in case there is another type, we can still write

      filename:S = p4

i have no idea whether this is possible and others agree, and if so, how
complicated it might be.  certainly nothing urgent.

      joachim

Date2025-07-29 19:11
Fromjoachim heintz
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] default types in contextes
thanks, yes; that's it indeed.
i added my examples as comment.

On 27/07/2025 15:43, Victor Lazzarini wrote:
> There is a longstanding enhancement issue on this
> https://github.com/csound/csound/issues/323  csound/issues/323>
> 
> 
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 27 Jul 2025, at 07:04, joachim heintz  wrote:
>>
>> *Warning*
>>
>> This email originated from outside of Maynooth University's Mail 
>> System. Do not reply, click links or open attachments unless you 
>> recognise the sender and know the content is safe.
>>
>> hi all -
>>
>> i am doing my first extended csound program (a generative sound
>> installation) with the amazing new features of current CS7.  it is such
>> a pleasure to work this way, and it is also so interesting to see how
>> big the impact of such a small change is that we can name variables now
>> without the leading i/k/a etc.
>>
>> one desire arose while working this way:
>> would it be possible to assign the type of a variable automatically if
>> the context is unambiguous?  for instance:
>>
>>       my_number = random:k(1,2)
>>
>> here the variable my_number is obviously of type k.
>>
>> or for p-field i would suggest to set i as default type, like
>>
>>       freq = p4
>>
>> in case there is another type, we can still write
>>
>>       filename:S = p4
>>
>> i have no idea whether this is possible and others agree, and if so, how
>> complicated it might be.  certainly nothing urgent.
>>
>>       joachim